示例#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);
        }