コード例 #1
0
        public void Validate_NestedWithGenerics_Test()
        {
            var dto = new DtoComplex().ByNestedClasses(typeof(NestedWithGenerics));

            var obj = new CopyClass_MyTemplateItem();

            var issues = dto.Validate(obj, x => x.RuleFor(t => t).ValidateDto()).Issues;

            issues.Should().HaveCount(1);
        }
コード例 #2
0
        public void Copy_NestedWithGenerics_WithIgnore_Test()
        {
            var dto = new DtoComplex().ByNestedClasses(typeof(NestedWithGenerics_WithIgnore));

            var src = new CopyClass0()
            {
                A = 1
            };
            var dst = new CopyClass_MyTemplateItem();

            var res = dto.Copy(dst, src);

            res.A.Should().BeNull();
        }
コード例 #3
0
        public void Update_NestedWithGenerics_Test1()
        {
            var dto = new DtoComplex().ByNestedClasses(typeof(NestedWithGenerics));

            var src = new CopyClass0()
            {
                A = 1
            };
            var dst = new CopyClass_MyTemplateItem();

            var res = dto.Update(dst, src);

            res.A.Should().BeNull();
        }