Пример #1
0
        public void CompositeView_Add_ShouldAddToList()
        {
            // Arrange
            var compositeView = new MyView();
            var view1         = MockRepository.GenerateMock <IView <object> >();
            var view2         = MockRepository.GenerateMock <IView <object> >();

            // Act
            compositeView.Add(view1);
            compositeView.Add(view2);

            // Assert
            var expected = new[] { view1, view2 };

            Assert.IsTrue(expected.SequenceEqual(compositeView.Views));
        }
Пример #2
0
        public void CompositeView_Add_ShouldThrowArgumentExceptionIfViewTypeIsWrong()
        {
            // Arrange
            var compositeView = new MyView();

            // Act
            compositeView.Add(MockRepository.GenerateMock <IView>());

            // Assert
        }
Пример #3
0
        public void CompositeView_Add_ShouldThrowArgumentNullExceptionIfViewIsNull()
        {
            // Arrange
            var compositeView = new MyView();

            // Act
            compositeView.Add(null);

            // Assert
        }