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); }
public void GetUsersList() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var list = dataSource.GetUsers(); Assert.AreNotEqual(0, list.Count, "No ReturnResults"); }
public void SavNfcTagOverrideTest() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var list = dataSource.GetNfcTags(); var nfcTag = list.LastOrDefault(); Assert.IsNotNull(nfcTag, "No Nfc Tag found."); nfcTag.Tag = Guid.NewGuid().ToString(); nfcTag.IsLocked = true; dataSource.SaveNfcTag(nfcTag); }
public void SaveUserOverrideTest() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var list = dataSource.GetUsers(); var user = list.LastOrDefault(); Assert.IsNotNull(user, "No User found."); user.Name = "#1"; user.AccessProfileIds = new List<string>(); user.AccessProfileIds.Add("2a3dc0e2-2108-4340-9bce-c79f956f987c"); user.AccessProfileIds.Add("3ce56ecc-3364-4ae0-b7b7-f064b91da03c"); user.AccessProfileIds.Add("c59331d1-8f48-486c-886b-7b57ed6f5837"); user.AccessProfileIdsUnevenWeeks = new List<string>(); user.AccessProfileIdsUnevenWeeks.Add("2a3dc0e2-2108-4340-9bce-c79f956f987c"); user.AccessProfileIdsUnevenWeeks.Add("3ce56ecc-3364-4ae0-b7b7-f064b91da03c"); user.AccessProfileIdsUnevenWeeks.Add("c59331d1-8f48-486c-886b-7b57ed6f5837"); user.NfcTag = ""; user.IsLocked = false; user.PasswordClear = "asdjafgn"; user.SurName = "TestUser"; dataSource.SaveUser(user); }
public void SaveUserCreateNewTest() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var user = new User(); user.Name = "asdasdasd"; user.NfcTag = "asdaasdgwesfasdfa"; user.IsLocked = true; user.PasswordClear = "asdawdjafgn"; user.SurName = "wqeqweqweqwe"; dataSource.SaveUser(user); }
public void SaveNfcTagCreateNewTest() { var dataSource = new NFCAccessControlDataSources.XMLDataSource.XmlDataSource(); var nfcTag = new NfcTag(); nfcTag.Tag = Guid.NewGuid().ToString(); nfcTag.IsLocked = false; dataSource.SaveNfcTag(nfcTag); }