public void ShouldAllowLoadToBeInvokedTwice() { var catalog = new TestableModuleCatalog(); var testableCatalog = new TestableModuleCatalog(); testableCatalog.Load(); Assert.AreEqual <int>(1, testableCatalog.LoadCalledCount); testableCatalog.Load(); Assert.AreEqual <int>(2, testableCatalog.LoadCalledCount); }
public void ShouldNotLoadAgainDuringInitialize() { var catalog = new TestableModuleCatalog(); var testableCatalog = new TestableModuleCatalog(); Assert.IsFalse(testableCatalog.LoadCalled); Assert.IsFalse(testableCatalog.ValidateCalled); testableCatalog.Load(); Assert.AreEqual <int>(1, testableCatalog.LoadCalledCount); testableCatalog.Initialize(); Assert.AreEqual <int>(1, testableCatalog.LoadCalledCount); }
public void ShouldNotLoadAgainIfInitializedCalledMoreThanOnce() { var catalog = new TestableModuleCatalog(); var testableCatalog = new TestableModuleCatalog(); Assert.False(testableCatalog.LoadCalled); Assert.False(testableCatalog.ValidateCalled); testableCatalog.Initialize(); Assert.Equal <int>(1, testableCatalog.LoadCalledCount); testableCatalog.Initialize(); Assert.Equal <int>(1, testableCatalog.LoadCalledCount); }
public void ShouldLoadAndValidateOnInitialize() { var catalog = new TestableModuleCatalog(); var testableCatalog = new TestableModuleCatalog(); Assert.IsFalse(testableCatalog.LoadCalled); Assert.IsFalse(testableCatalog.ValidateCalled); testableCatalog.Initialize(); Assert.IsTrue(testableCatalog.LoadCalled); Assert.IsTrue(testableCatalog.ValidateCalled); Assert.IsTrue(testableCatalog.LoadCalledFirst); }
public void ShouldRevalidateWhenAddingNewModuleIfValidated() { var testableCatalog = new TestableModuleCatalog(); testableCatalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo("ModuleA") }); testableCatalog.Validate(); testableCatalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo("ModuleB") }); Assert.IsTrue(testableCatalog.ValidateCalled); }
public void ShouldAllowLoadToBeInvokedTwice() { var catalog = new TestableModuleCatalog(); var testableCatalog = new TestableModuleCatalog(); testableCatalog.Load(); Assert.AreEqual<int>(1, testableCatalog.LoadCalledCount); testableCatalog.Load(); Assert.AreEqual<int>(2, testableCatalog.LoadCalledCount); }
public void ShouldNotLoadAgainDuringInitialize() { var catalog = new TestableModuleCatalog(); var testableCatalog = new TestableModuleCatalog(); Assert.IsFalse(testableCatalog.LoadCalled); Assert.IsFalse(testableCatalog.ValidateCalled); testableCatalog.Load(); Assert.AreEqual<int>(1, testableCatalog.LoadCalledCount); testableCatalog.Initialize(); Assert.AreEqual<int>(1, testableCatalog.LoadCalledCount); }