Esempio n. 1
0
        public void AssertValidOnInvalidObjectThrowsArgumentException()
        {
            var sut = new TestModel();

            var ex = Assert.Throws <ArgumentException>(() => sut.AssertValid("sut"));

            Assert.Equal("sut", ex.ParamName);
            Assert.Contains("Name: Value is required.", ex.Message);
        }
        public void AssertValidOnInvalidObjectThrowsArgumentException()
        {
            var sut = new TestModel();

            var ex = Assert.Throws<ArgumentException>(() => sut.AssertValid("sut"));

            Assert.Equal("sut", ex.ParamName);
            Assert.Contains("Name: Value is required.", ex.Message);
        }
Esempio n. 3
0
        public void AssertValidOnValidObjectDoesNotThrowException()
        {
            var sut = new TestModel
            {
                Name     = "Name",
                SubModel = new SubModel
                {
                    Property1 = "1"
                }
            };

            sut.AssertValid("sut");
        }
        public void AssertValidOnValidObjectDoesNotThrowException()
        {
            var sut = new TestModel
            {
                Name = "Name",
                SubModel = new SubModel
                {
                    Property1 = "1"
                }
            };

            sut.AssertValid("sut");
        }