public void 大会期間を年月日で表示する() { var act = new ApplicationPeriod( new DateTime(2020, 9, 25), new DateTime(2020, 10, 2)); Assert.Equal("2020年9月25日 ~ 2020年10月2日", act.DisplayValue); }
public void 大会期間をスラッシュで表示する() { var act = new ApplicationPeriod( new DateTime(2020, 9, 25), new DateTime(2020, 10, 2)); Assert.Equal("2020/9/25 ~ 2020/10/2", act.ShortDisplayValue); }
public void JSONのシリアライズとデシリアライズが正常に実行されること( int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay) { var startDate = new DateTime(startYear, startMonth, startDay); var endDate = new DateTime(endYear, endMonth, endDay); var oldApplicationPeriod = new ApplicationPeriod(startDate, endDate); var json = oldApplicationPeriod.ToJson(); var newApplicationPeriod = ApplicationPeriod.FromJson(json); Assert.Equal(startDate, newApplicationPeriod.StartDate); Assert.Equal(endDate, newApplicationPeriod.EndDate); }
public void Configure(EntityTypeBuilder <Tournament> builder) { builder.ToTable("tournaments"); builder.Property(o => o.Id).HasSnakeCaseColumnName(); builder.Property(o => o.AggregationMonth) .HasConversion(o => o.Value, o => new AggregationMonth(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.ApplicationPeriod) .HasConversion(o => o.ToJson(), o => ApplicationPeriod.FromJson(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.EntryFee) .HasConversion(o => o.Value, o => new EntryFee(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.HoldingPeriod) .HasConversion(o => o.ToJson(), o => HoldingPeriod.FromJson(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.Outline) .HasConversion(o => o.Value, o => new Outline(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.RegistrationYear) .HasConversion(o => o.Value, o => new RegistrationYear(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.TournamentName) .HasConversion(o => o.Value, o => new TournamentName(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.Venue) .HasConversion(o => o.Value, o => new Venue(o)) .HasSnakeCaseColumnName(); builder.Property(o => o.MethodOfPayment) .HasEnumerationConversion() .HasSnakeCaseColumnName(); builder.Property(o => o.TournamentType) .HasEnumerationConversion() .HasSnakeCaseColumnName(); builder.Property(o => o.TypeOfYear) .HasEnumerationConversion() .HasSnakeCaseColumnName(); builder.Property(o => o.TournamentEntryReceptionMailSubject).HasSnakeCaseColumnName(); builder.Property(o => o.TournamentEntryReceptionMailBody).HasSnakeCaseColumnName(); }