public void UnsafeRegisterUnityTest() { // Arrange var target = new TestRegistrar(); DIContainer.Reset(); // Act target.UnsafeRegister( null, null, false); // Assert Assert.IsTrue(DIContainer.IsInitialized); Assert.IsTrue(target.AreRegistered()); Assert.IsTrue(target.RanRegistration); Assert.IsFalse(target.RanTestRegistration); }
public void TestUnsafeRegisterTest() { // Arrange var target = new TestRegistrar(); var unityMoq = new Mock <IUnityContainer>(); unityMoq.Setup(c => c.Registrations) .Returns(new List <ContainerRegistration>()); // Act target.UnsafeRegister( unityMoq.Object, unityMoq.Object.GetRegistrationsSnapshot(), true); // Assert Assert.IsTrue(target.AreRegistered(unityMoq.Object)); Assert.IsFalse(target.RanRegistration); Assert.IsTrue(target.RanTestRegistration); }