public void AddRfiTest() { IList <RequestForInformation> rfis = this.repository.FindAll(); // Create a new RequestForInformation Project project = ProjectService.GetAllProjects()[0]; RequestForInformation rfi = new RequestForInformation(project.Key, 2); IList <ItemStatus> statuses = SubmittalService.GetItemStatuses(); rfi.From = project.Contacts[0]; rfi.Status = statuses[0]; rfi.Contractor = CompanyService.GetAllCompanies()[0]; IList <SpecificationSection> specSections = SubmittalService.GetSpecificationSections(); rfi.SpecSection = specSections[0]; // Add the RFI to the Repository this.repository.Add(rfi); // Commit the transaction this.unitOfWork.Commit(); // Reload the RFI and verify it's number RequestForInformation savedRfi = repository.FindBy(rfi.Key); Assert.AreEqual(2, savedRfi.Number); }
public void FindRfiByKeyTest() { RequestForInformation rfi = this.repository.FindBy("6c42ec93-10d7-4b55-b564-a5d1308a00a4"); Assert.AreEqual(1, rfi.Number); }