コード例 #1
0
        public void CannotAddNullToComposite()
        {
            var sut = new TaskComposite(arbitraryName);

            var exception = Record.Exception(() => sut.Add(null));

            Assert.IsType <ArgumentNullException>(exception);
        }
コード例 #2
0
        public void ContainsComponentInComposite2()
        {
            var sut       = new TaskComposite(arbitraryName);
            var component = new Mock <ITaskComponent>().Object;

            sut.Add(component);

            Assert.True(sut.Contains(component));
        }
コード例 #3
0
        public void AddComponentToComposite()
        {
            var sut       = new TaskComposite(arbitraryName);
            var component = new Mock <ITaskComponent>().Object;

            sut.Add(component);

            Assert.True(sut.Any(tc => tc == component));
        }
コード例 #4
0
        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));
        }