public void AddFilter_AddingAFilterForEmptyManager_FilterManagerHasOneFilter() { // Arrange FilterManager target = new FilterManager(); var filter = Mock.Create<IFilter>(); // Act target.AddFilter(filter); // Assert Assert.IsTrue(target.CurrentFilters.Contains(filter)); }
public void AddFilter_AddingAFilterWhenFilterIsAlreadyAdded_FilterManagerHasOneFilter() { // Arrange FilterManager target = new FilterManager(); var filter = Mock.Create<IFilter>(); // Act target.AddFilter(filter); target.AddFilter(filter); // Assert Assert.IsTrue(target.CurrentFilters.Length == 1); }
public void Process_CommandIsPending_ShouldCallProcessFilters() { // Arrange FilterManager target = new FilterManager(); bool expected = false; //Mock.Arrange(() => target.ProcessFilters(null)) var command = Mock.Create<CommandBase>(); Mock.Arrange(() => command.CurrentState).Returns(CommandState.Pending); // Act var result = target.Process(command); // Assert Assert.IsTrue(result); }
public void RemoveFilter_RemovingAFilterWhenFilterExist_FilterManagerRemainEmptyFilters() { // Arrange FilterManager target = new FilterManager(); var filter = Mock.Create<IFilter>(); target.AddFilter(filter); // Act target.RemoveFilter(filter); // Assert Assert.IsTrue(target.CurrentFilters.Length == 0); }
public void RemoveFilter_RemovingAFilterWhenOtherFilterExist_FilterManagerShouldContainThatFilters() { // Arrange FilterManager target = new FilterManager(); var filter = Mock.Create<IFilter>(); var filter2 = Mock.Create<IFilter>(); target.AddFilter(filter); target.AddFilter(filter2); // Act target.RemoveFilter(filter); // Assert Assert.IsTrue(target.CurrentFilters.Contains(filter2)); Assert.IsFalse(target.CurrentFilters.Contains(filter)); }