public void UpdateMember() { var account = new ManageAccountController(new AdminList(), new ManagerList(), new MemberList(), new ProviderList()); var member = new Member(); member.Name = "Cheng luo"; member.StreetAddress = "123 77th Ave S"; member.State = "MN"; member.City = "Saint Cloud"; member.ZipCode = "12345"; var newMemberId = account.AddMember(member); Assert.IsTrue(null != newMemberId, "Failed to add a new member."); Member m = new Member(); m.Name = "PST"; m.ID = newMemberId.Value; m.StreetAddress = "123 77th Ave S"; m.State = "MN"; m.City = "Saint Cloud"; m.ZipCode = "19191"; m.Status = 0; var updatedMember = account.UpdateMember(m); Assert.IsTrue(null != updatedMember, "Failed to update a member."); var success = account.DeleteMember(newMemberId.Value); Assert.IsTrue(success, "failed to delete member"); }
public void TestVerifyProviderReportFees() { var accountController = new ManageAccountController(new AdminList(), new ManagerList(), new MemberList(), new ProviderList()); var serviceController = new ManageServiceController(new MemberList(), new ProviderList(), new ProviderDirectory(), new ServiceRecordList()); var reportController = new ManageReportController(new MemberList(), new ProviderList(), new ProviderDirectory(), new ScheduleList(), new ServiceRecordList()); var newMember = new Member() { Name = "John Deere", City = "Maple Grove", State = "MN", StreetAddress = "11 st 25", ZipCode = "12345", Status = MemberStatus.ACCEPTED }; var newProvider = new Provider() { Name = "John Deere", City = "Maple Grove", State = "MN", StreetAddress = "11 st 25", ZipCode = "12345", BankAccount = 1234567890 }; var newMemberId = accountController.AddMember(newMember); var newProviderId = accountController.AddProvider(newProvider); Assert.IsTrue(newMemberId.HasValue, "unable to add new member"); Assert.IsTrue(newProviderId.HasValue, "unable to add new provider"); var services = serviceController.GetAllServices(); var serviceCode = null != services && services.Any() ? services.First().ServiceCode : new int?(); Assert.IsTrue(serviceCode.HasValue, "unable to get service code"); var newServiceRecord = new ServiceRecord(serviceCode.Value, DateTime.Now, DateTime.Today, newProviderId.Value, newMemberId.Value, "test"); var newServiceRecordId = serviceController.AddServiceRecord(newServiceRecord); Assert.IsTrue(newServiceRecordId.HasValue, "unable to add service record"); var feeVerified = true; var verifyReportInput = new VerifyReportViewModel(newProviderId.Value, DateTime.Today.AddDays(-2), DateTime.Today.AddDays(1)); var success = reportController.VerifyProviderReportFees(verifyReportInput); var serviceRecord = serviceController.GetServiceRecord(newServiceRecordId.Value); Assert.IsTrue(null != serviceRecord, "unable to get service record"); Assert.AreEqual(serviceRecord.FeeVerified, feeVerified, "service verified are not equal"); }
public void AddMember() { var account = new ManageAccountController(new AdminList(), new ManagerList(), new MemberList(), new ProviderList()); var member = new Member(); member.Name = "Cheng luo"; member.StreetAddress = "123 77th Ave S"; member.State = "MN"; member.City = "Saint Cloud"; member.ZipCode = "12345"; var result = account.AddMember(member); Assert.IsTrue(null != result, "Failed to add a new member."); }
public void TestGetServiceRecord() { var serviceController = new ManageServiceController(new MemberList(), new ProviderList(), new ProviderDirectory(), new ServiceRecordList()); var accountConroller = new ManageAccountController(new AdminList(), new ManagerList(), new MemberList(), new ProviderList()); var newService = new Service(222255, "Hypno Thrpy", 55.50m); var newMember = new Member() { Name = "Jonas Bros", StreetAddress = "21 Jump Street", City = "St. Paul", State = "MN", ZipCode = "12345", }; var newProvider = new Provider() { Name = "Mario Bros", StreetAddress = "22 Jump Street", City = "Minneapolis", State = "MN", ZipCode = "54321" }; var success = serviceController.AddService(newService); var memberId = accountConroller.AddMember(newMember); var providerId = accountConroller.AddProvider(newProvider); Assert.IsTrue(memberId.HasValue, "add member failed"); Assert.IsTrue(providerId.HasValue, "add provider failed"); var newServiceRecord = new ServiceRecord(222255, DateTime.Now, DateTime.Today, providerId.Value, memberId.Value, "all green"); var newServiceRecordId = serviceController.AddServiceRecord(newServiceRecord); Assert.IsTrue(newServiceRecordId.HasValue, "add service record failed"); var serviceRecord = serviceController.GetServiceRecord(newServiceRecordId.Value); Assert.AreEqual(serviceRecord.ServiceCode, newServiceRecord.ServiceCode, "service code does not match"); Assert.AreEqual(serviceRecord.MemberNumber, newServiceRecord.MemberNumber, "member number does not match"); Assert.AreEqual(serviceRecord.ProviderNumber, newServiceRecord.ProviderNumber, "provider number does not match"); Assert.AreEqual(serviceRecord.DateProvided, newServiceRecord.DateProvided, "date provided does not match"); // Assert.AreEqual(serviceRecord.TimeStamp, newServiceRecord.TimeStamp, "timestamp does not match"); Assert.AreEqual(serviceRecord.Comments, newServiceRecord.Comments, "comments does not match"); }