Exemple #1
0
        public void ApplyTo_returns_success_when_expected(CompositeType test)
        {
            var sut = new PropertyConstraint <CompositeType>(ct => ct.StringValue, Is.EqualTo(test.StringValue));

            var result = sut.ApplyTo(test);

            Assert.That(result.IsSuccess, Is.True);
        }
Exemple #2
0
        public void ApplyTo_throws_not_supported_if_test_is_not_same_as_type(object test)
        {
            var sut = new PropertyConstraint <CompositeType>(ct => ct.StringValue, Is.EqualTo("Hello world"));

            Assert.That(() => sut.ApplyTo(test), Throws.Exception.TypeOf <NotSupportedException>());
        }