/Source/Bifrost.Specs/Resources/for_ResourceInterceptor/when_intercepting.cs
C# | 25 lines | 21 code | 4 blank | 0 comment | 0 complexity | 36337adee73481647aabc2fac2eee70d MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using Machine.Specifications;
-
- namespace Bifrost.Specs.Resources.for_ResourceInterceptor
- {
- public class when_intercepting : given.a_resource_interceptor
- {
- const string expected = "Something";
- static FakeInvocation invocation;
- static ClassWithString resources;
- static string resource_string;
-
- Establish context = () =>
- {
- resources = new ClassWithString();
- invocation = new FakeInvocation();
- invocation.Method = ClassWithString.SomeStringProperty.GetGetMethod();
- invocation.ReturnValueToSetOnProceed = expected;
- resource_resolver_mock.Setup(r=>r.Resolve(Moq.It.IsAny<string>())).Callback((string s) => resource_string = s);
- };
-
- Because of = () => interceptor.Intercept(invocation);
-
- It should_combine_type_and_propertyname_as_resource_name = () => resource_string.ShouldEqual(typeof(ClassWithString).Name + "." + ClassWithString.SomeStringProperty.Name);
- }
- }