I have the following in the test (my first JustMock test, I could add) ...
var template = Mock.Create<MessageType>();
Mock.Arrange(() => template.Subject)
.Returns("This template has Zero tokens.");
Mock.Arrange(() => template.Body)
.Returns("This template has {{number}} of {{tokens}}.");
The mocked class looks like this:
public class MessageType : BaseBusinessEntity
{
public string Body { get; set; }
public int DigestsToBeIncludedOn { get; set; }
public Guid MessageReference { get; set; }
public int MessageTypeId { get; set; }
public string Name { get; set; }
public int PredefinedRecipients { get; set; }
public string Subject { get; set; }
}
When I try to run a test, I get ...
: Genesis.Service.Implementation.Tests.DigestFixture.ShouldCorrectlyExtractTemplateTokens : Telerik.JustMock.Core.ElevatedMockingException: "System.String get_Subject()". , . : Telerik.JustMock.Core.ProfilerInterceptor.ThrowElevatedMockingException(MemberInfo ) Telerik.JustMock.Core.MocksRepository.CheckMethodInterceptorAvailable(IMatcher instanceMatcher, MethodBase) Telerik.JustMock.Core.MocksRepository.AddArrange(IMethodMock Mock) Telerik.JustMock.Core.MocksRepository.Arrange [TMethodMock] ( expr, Func 1 methodMockFactory) at
Telerik.JustMock.Mock.<>c__DisplayClass8 1.b__6() at Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal [] (Func 1
guardedAction) at Telerik.JustMock.Mock.Arrange[TResult](Expression 1 ) Genesis.Service.Implementation.Tests.DigestFixture.ShouldCorrectlyExtractTemplateTokens() C:\Genesis\Development\Genesis.Service.Implementation.Tests\DigestFixture.cs: 46
- , ?