示例#1
0
        public void IsValidReturnsWhetherStringIsValidTest(string value, bool expected)
        {
            var sut = new NoSlashAttribute();

            var actual = sut.IsValid(value);

            actual.Should().Be(expected);
        }
示例#2
0
        public void IsValidReturnsTrueWithUnsupportedValueTypeTest()
        {
            var sut = new NoSlashAttribute();

            var actual = sut.IsValid(Guid.NewGuid());

            actual.Should().BeTrue();
        }
示例#3
0
        public void IsValidReturnsTrueWithNullValueTest()
        {
            var sut = new NoSlashAttribute();

            var actual = sut.IsValid(null);

            actual.Should().BeTrue();
        }
示例#4
0
        public void IsValidReturnsWhetherListStringIsValidTest(string value, bool expected)
        {
            var items = new List <string>
            {
                "first",
                value,
                "second"
            };
            var sut = new NoSlashAttribute();

            var actual = sut.IsValid(items);

            actual.Should().Be(expected);
        }