コード例 #1
0
        public new void CreateSampleModels()
        {
            var calendar = new Calendar("CAL_0000");
            calendar.AddMetadata("a", new MetadataValue("A"));
            calendar.AddMetadata("b", new MetadataValue("B"));
            calendar.AddLocale(new CultureInfo("en"), new CalendarLocale {Name = "Calendar"});
            calendar.AddLocale(new CultureInfo("ko"), new CalendarLocale {Name = "달력"});
            Repository<Calendar>.SaveOrUpdate(calendar);

            var calendarRule = new CalendarRule(calendar, "테스트규칙");
            Repository<CalendarRule>.SaveOrUpdate(calendarRule);
        }
コード例 #2
0
        public void CalendarTestByUnitOfWork()
        {
            var calendar = new Calendar("CAL_0001");
            calendar.AddMetadata("a", new MetadataValue("A"));
            calendar.AddMetadata("b", new MetadataValue("B"));
            calendar.AddLocale(new CultureInfo("en"), new CalendarLocale {Name = "System Calendar"});
            calendar.AddLocale(new CultureInfo("ko"), new CalendarLocale {Name = "시스템달력"});

            Repository<Calendar>.SaveOrUpdate(calendar);
            UnitOfWork.Current.TransactionalFlush();
            UnitOfWork.Current.Clear();

            var loaded = Repository<Calendar>.Get(calendar.Id);
            Assert.AreEqual(calendar, loaded);

            loaded.LocaleMap.Count.Should().Be(2);
        }