public void CannotAddNullToComposite() { var sut = new TaskComposite(arbitraryName); var exception = Record.Exception(() => sut.Add(null)); Assert.IsType <ArgumentNullException>(exception); }
public void ContainsComponentInComposite2() { var sut = new TaskComposite(arbitraryName); var component = new Mock <ITaskComponent>().Object; sut.Add(component); Assert.True(sut.Contains(component)); }
public void AddComponentToComposite() { var sut = new TaskComposite(arbitraryName); var component = new Mock <ITaskComponent>().Object; sut.Add(component); Assert.True(sut.Any(tc => tc == component)); }
public void RemoveComponentFromComposite2() { var sut = new TaskComposite(arbitraryName); var component = new Mock <ITaskComponent>().Object; sut.Add(component); sut.Remove(component); Assert.False(sut.Any(tc => tc == component)); }