Esempio n. 1
0
        public void Validate_Dto_With_Values_Enums()
        {
            var data = new FixtureExtensions().GetSubEntityWithValues();
            var actual = data.ConvertToDto<FixturePublic.Public4DTO>();

            var values = actual.GetType().GetProperties().Select(x => x.GetValue(actual));
            values.Should().NotContainNulls();
        }
Esempio n. 2
0
        public void Validate_Entity_When_Sub_Entity_Converted_Dto()
        {
            var data = new FixtureExtensions().GetEntityWithValues();
            var dto = data.ConvertToDto<FixturePublic.Public3DTO>();
            var actual = dto.ConvertToEntity<FixturePublic.Entity>();

            Assert.IsNotNull(actual.Third.Third);

            //Get all values from actual.Third.Third
            var values = actual
                            .GetType()
                            .GetProperty("Third")
                            .GetValue(actual)
                            .GetType()
                            .GetProperties()
                            .Select(x => x.GetValue(actual
                                                    .GetType()
                                                    .GetProperty("Third")
                                                    .GetValue(actual)));
            values.Should().NotContainNulls();
        }
Esempio n. 3
0
        public void Validate_Entity_When_The_Properties_Are_Equals()
        {
            var data = new FixtureExtensions().GetEntityWithValues();
            var dto = data.ConvertToDto<FixturePublic.Public2DTO>();
            var actual = dto.ConvertToEntity<FixturePublic.Entity>();

            var values = actual
                           .GetType()
                           .GetProperty("Third")
                           .GetValue(actual)
                           .GetType()
                           .GetProperties()
                           .Select(x => x.GetValue(actual
                                                   .GetType()
                                                   .GetProperty("Third")
                                                   .GetValue(actual)));
            values.Should().NotContainNulls();

            Assert.IsNotNullOrEmpty(actual.FirstProperty);
            Assert.IsNotNullOrEmpty(actual.Second);
        }
Esempio n. 4
0
        public void Validate_Entity_With_Values_Enums()
        {
            var data = new FixtureExtensions().GetSubEntityWithValues();
            var dto = data.ConvertToDto<FixturePublic.Public4DTO>();
            var actual = dto.ConvertToEntity<FixturePublic.SubEntity>();

            Assert.IsTrue(actual.Second == data.Second);
        }