Exemple #1
0
        public void IsIgnoredReturnsTrueWhenParameterMatchesValueTypePropertyWithNameMatch()
        {
            var configuration = Model.UsingDefaultConfiguration();
            var value         = Environment.TickCount;
            var model         = new StructMatchingNameWrapper <int>(value);
            var propertyInfo  =
                typeof(StructMatchingNameWrapper <int>).GetProperty(nameof(StructMatchingNameWrapper <int> .Value)) !;
            var args = new object?[]
            {
                value
            };

            var sut = new DefaultPropertyResolver(CacheLevel.PerInstance);

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

            actual.Should().BeTrue();
        }
Exemple #2
0
        public void IsIgnoredReturnsTrueWhenParameterMatchesStructPropertyWithNameMatch()
        {
            var configuration = Model.UsingDefaultConfiguration();
            var value         = new StructModel {
                FirstName = Guid.NewGuid().ToString()
            };
            var model        = new StructMatchingNameWrapper <StructModel>(value);
            var propertyInfo =
                typeof(StructMatchingNameWrapper <StructModel>).GetProperty(nameof(StructMatchingNameWrapper <StructModel>
                                                                                   .Value)) !;
            var args = new object?[]
            {
                value
            };

            var sut = new DefaultPropertyResolver(CacheLevel.PerInstance);

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

            actual.Should().BeTrue();
        }