public Setup ( MVCSContext context ) : void | ||
context | MVCSContext | |
Résultat | void |
public void testMapBindsIApplicationToApplicationWrapperAsASingleton() { var mockBinder = Substitute.For <ICrossContextInjectionBinder>(); var fakeContext = new MVCSContext(); fakeContext.injectionBinder = mockBinder; var mockBinding = Substitute.For <IInjectionBinding>(); mockBinder.Bind <IApplication>().Returns(mockBinding); mockBinder.Bind <IResources>().Returns(mockBinding); mockBinder.Bind <IGameObject>().Returns(mockBinding); var mockFinalBinding = Substitute.For <IInjectionBinding>(); mockBinding.To <ApplicationWrapper>().Returns(mockFinalBinding); _instance.Setup(fakeContext); mockBinder.Received().Bind <IApplication>(); mockBinding.Received().To <ApplicationWrapper>(); mockBinder.Received().Bind <IResources>(); mockBinding.Received().To <ResourcesWrapper>(); mockBinder.Received().Bind <IGameObject>(); mockBinding.Received().To <GameObjectWrapper>(); mockFinalBinding.Received().ToSingleton(); }
public void testMapBindsIApplicationToApplicationWrapperAsASingleton() { var mockContext = Substitute.For <ICrossContextCapable>(); var mockBinder = Substitute.For <ICrossContextInjectionBinder>(); mockContext.injectionBinder.Returns(mockBinder); var mockBinding = Substitute.For <IInjectionBinding>(); mockBinder.Bind <IApplication>().Returns(mockBinding); var mockFinalBinding = Substitute.For <IInjectionBinding>(); mockBinding.To <ApplicationWrapper>().Returns(mockFinalBinding); _instance.Setup(mockContext); mockBinder.Received().Bind <IApplication>(); mockBinding.Received().To <ApplicationWrapper>(); mockFinalBinding.Received().ToSingleton(); }