Пример #1
0
        public void TestModelAccessors()
        {
            var expectedModel = "Test value";

            // act
            var sut = new Gadget(expectedModel, new VideoPort[0]);
            var result = sut.Model;

            // assert
            Assert.AreEqual(expectedModel, result);
        }
Пример #2
0
        public void TestTitleAccessors()
        {
            var sut = new Gadget();
            var expectedTitle = "Test value";

            // act
            sut.Title = expectedTitle;
            var result = sut.Title;

            // assert
            Assert.AreEqual(expectedTitle, result);
        }
Пример #3
0
        public void TestDescriptionGetter()
        {
            var title = "Title";
            var model = "Model";
            var format = "{0} ||||||| {1}";

            var expectedDescription = string.Format(format, title, model);

            // act
            var sut = new Gadget(model, new VideoPort[0]);
            sut.Title = title;

            var result = sut.GetDescription(format);

            // assert
            Assert.AreEqual(expectedDescription, result);
        }
Пример #4
0
        public void TestVideoports()
        {
            // act
            var videoPort = new VideoPort
            {
                Name = "VGA"
            };

            var sut = new Gadget("Model", new[]
            {
                videoPort,
            });

            // assert
            Assert.AreEqual(sut.Videoports.Count, 1);
            Assert.AreEqual(sut.Videoports[0], videoPort);
        }