Ejemplo n.º 1
0
        public static DateRecurrence FromDto(DateRecurrenceDto dto)
        {
            var retVal = new DateRecurrence();

            retVal.UpdateFromDto(dto);
            return(retVal);
        }
Ejemplo n.º 2
0
        public static DateRecurrenceDto ToDto(DateRecurrence model)
        {
            var retVal = new DateRecurrenceDto();

            model.UpdateDto(retVal);
            return(retVal);
        }
Ejemplo n.º 3
0
 public void UpdateFromDto(DateRecurrenceDto dto)
 {
     base.UpdateFromDto(dto);
     this.RecurFromType      = dto.RecurFromType;
     this.MaxRecurrenceCount = dto.MaxRecurrenceCount;
     this.StartDate          = dto.StartDate;
     this.EndDate            = dto.EndDate;
 }
        public void DtoAndDomainRoundTrip()
        {
            Fixture fixture = TestHelper.CreateSerializationAutoFixture();

            DateRecurrenceDto sourceDto = fixture.Create <DateRecurrenceDto>();
            DateRecurrence    domain    = DateRecurrence.FromDto(sourceDto);
            DateRecurrenceDto targetDto = DateRecurrence.ToDto(domain);

            var sourceDtoLikeness = sourceDto.AsSource().OfLikeness <DateRecurrenceDto>();

            sourceDtoLikeness.ShouldEqual(targetDto);
        }
        public void DtoAndLiteDbRoundTrip()
        {
            Fixture fixture = TestHelper.CreateSerializationAutoFixture(useLiteDBCompatibleDateTime: true);

            DateRecurrenceDto sourceDto = fixture.Create <DateRecurrenceDto>();
            DateRecurrenceDto targetDto;

            using (var db = new LiteDatabase(new MemoryStream()))
            {
                var col = db.GetCollection <DateRecurrenceDto>();
                var id  = col.Insert(sourceDto);
                targetDto = col.FindById(id);
            }

            var sourceDtoLikeness = sourceDto.AsSource().OfLikeness <DateRecurrenceDto>();

            sourceDtoLikeness.ShouldEqual(targetDto);
        }