public void SavAccessProfileOverrideTest() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var list = dataSource.GetAccessProfiles(); var accessProfile = list.LastOrDefault(); Assert.IsNotNull(accessProfile, "No Access Profile found."); accessProfile.Name = "TestProfiles #1"; accessProfile.LockDays = new List<LockDay>() { new LockDay() {Description = "Test#1", StartTime = DateTime.Now, EndTime = DateTime.Now}, new LockDay() {Description = "Test#2", StartTime = DateTime.Now, EndTime = DateTime.Now}, new LockDay() {Description = "Test#3", StartTime = DateTime.Now, EndTime = DateTime.Now}, new LockDay() {Description = "Test#4", StartTime = DateTime.Now, EndTime = DateTime.Now} }; accessProfile.MondayAccess = new WeekDay() { Day = DayOfWeekEnum.Monday, StartTime = 2, EndTime = 8 }; accessProfile.TuesdayAccess = new WeekDay() { Day = DayOfWeekEnum.Tuesday, StartTime = 2, EndTime = 8 }; accessProfile.WednesdayAccess = new WeekDay() { Day = DayOfWeekEnum.Wednesday, StartTime = 2, EndTime = 8 }; accessProfile.ThursdayAccess = new WeekDay() { Day = DayOfWeekEnum.Thursday, StartTime = 2, EndTime = 8 }; accessProfile.FridayAccess = new WeekDay() { Day = DayOfWeekEnum.Friday, StartTime = 2, EndTime = 8 }; accessProfile.SaturdayAccess = new WeekDay() { Day = DayOfWeekEnum.Saturday, StartTime = 2, EndTime = 8 }; accessProfile.SundayAccess = new WeekDay() { Day = DayOfWeekEnum.Sunday, StartTime = 2, EndTime = 8 }; accessProfile.ValidTill = DateTime.Now; dataSource.SaveAccessProfile(accessProfile); }
public void SaveAccessProfileCreateNewTest() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var accessProfile = new AccessProfile(); accessProfile.Name = "TestProfiles #2"; accessProfile.LockDays = new List<LockDay>() { new LockDay() {Description = "Test#4", StartTime = DateTime.Now, EndTime = DateTime.Now}, new LockDay() {Description = "Test#5", StartTime = DateTime.Now, EndTime = DateTime.Now}, new LockDay() {Description = "Test#6", StartTime = DateTime.Now, EndTime = DateTime.Now}, new LockDay() {Description = "Test#7", StartTime = DateTime.Now, EndTime = DateTime.Now} }; accessProfile.MondayAccess = new WeekDay() {Day = DayOfWeekEnum.Monday, StartTime = 1, EndTime = 13}; accessProfile.TuesdayAccess = new WeekDay() {Day = DayOfWeekEnum.Tuesday, StartTime = 4, EndTime = 11}; accessProfile.WednesdayAccess = new WeekDay() {Day = DayOfWeekEnum.Wednesday, StartTime = 6, EndTime = 21}; accessProfile.ThursdayAccess = new WeekDay() {Day = DayOfWeekEnum.Thursday, StartTime = 3, EndTime = 19}; accessProfile.FridayAccess = new WeekDay() {Day = DayOfWeekEnum.Friday, StartTime = 3, EndTime = 16}; accessProfile.SaturdayAccess = new WeekDay() {Day = DayOfWeekEnum.Saturday, StartTime = 1, EndTime = 12}; accessProfile.SundayAccess = new WeekDay() {Day = DayOfWeekEnum.Sunday, StartTime = 18, EndTime = 24}; accessProfile.ValidTill = DateTime.Now; dataSource.SaveAccessProfile(accessProfile); }