示例#1
0
        public void IsIgnoredReturnsFalseWhenParameterMatchesValueTypePropertyWithNameMismatch()
        {
            var configuration = Model.UsingDefaultConfiguration();
            var item          = Environment.TickCount;
            var model         = new StructMismatchingNameWrapper <int>(item);
            var propertyInfo  =
                typeof(StructMismatchingNameWrapper <int>).GetProperty(nameof(StructMismatchingNameWrapper <int> .Value)) !;
            var args = new object?[]
            {
                item
            };

            var sut = new DefaultPropertyResolver(CacheLevel.PerInstance);

            var actual = sut.IsIgnored(configuration, model, propertyInfo, args);

            actual.Should().BeFalse();
        }
示例#2
0
        public void IsIgnoredReturnsFalseWhenParameterMatchesStructPropertyWithNameMismatch()
        {
            var configuration = Model.UsingDefaultConfiguration();
            var item          = new StructModel {
                FirstName = Guid.NewGuid().ToString()
            };
            var model        = new StructMismatchingNameWrapper <StructModel>(item);
            var propertyInfo =
                typeof(StructMismatchingNameWrapper <StructModel>).GetProperty(
                    nameof(StructMismatchingNameWrapper <StructModel> .Value)) !;
            var args = new object?[]
            {
                item
            };

            var sut = new DefaultPropertyResolver(CacheLevel.PerInstance);

            var actual = sut.IsIgnored(configuration, model, propertyInfo, args);

            actual.Should().BeFalse();
        }