/// <summary> ///A test for ValidateAciXml ///</summary> private int CreateOrder(int formId) { base.InitDbContext(); IOrderRepository orderRepository = new OrderRepository(this.DbFactory); ICommitProvider commitProvider = new CommitProvider(this.DbFactory); int rand = new Random().Next(0, 100000); var loanAndContactInfo = new OrderLoanAndContactInfo { Contacts = new List<OrderContact>() { new OrderContact { ContactRoleId = 2, Email = String.Format("mial{0}@mail.com", rand), Name = "Name" + rand, Phone = "123" + rand } }, LoanPurposeTypeId = 4, GFEDate = DateTime.Now.AddDays(100), GFEAmount = 9999.99, }; var generalInfo = new OrderGeneralInfo { BorrowerFirstName = "Test" + rand, BorrowerLastName = "Test" + rand, LoanNumber = "100" + rand, PropertyAddress = new Address { City = "New York", County = "Test", State = "NY", ZIP = "12345", Street = "Wallstreet" } }; var appraisalInfo = new OrderAppraisalInfo { PropertyTypeId = 3, OccupancyTypeId = 1, AppraisalTypeId = 1, Rush = true, SecondDuplicateAppraisal = true, LoanType = LoanType.Conventional, NumberUnits = 7, AppraisalType = AppraisalType.Appraisal, AppraisalForm = formId, ReviewForm = 0 }; Order order = new Order { OrderPublicId = "000" + rand, AppraiserOrderDeliveryType = 3, CreationDate = DateTime.Now, LoanAndContactInfo = loanAndContactInfo, AppraisalInfo = appraisalInfo, CreatedByClientUserId = 1, OrderStatusId = OrderStatus.PendingAssignment.ToString(), DueDate = DateTime.Now.AddDays(10), Latitude = 43, Longitude = -73, GeneralInfo = generalInfo }; orderRepository.Add(order); commitProvider.Commit(); return order.Id; }
public void ValidateForm1004_2055() { IAciXmlFieldsRepository aciXmlFieldsRepository = new AciXmlFieldsRepository(this.DbFactory); IAciXmlRepository aciXmlRepository = new AciXmlRepository(this.DbFactory); IOrderRepository orderRepository = new OrderRepository(this.DbFactory); ICommitProvider commitProvider = new CommitProvider(this.DbFactory); IAciManager target = new AciManager(aciXmlFieldsRepository, aciXmlRepository, orderRepository, commitProvider); int orderId = CreateOrder(1); var embededResourceName = "DVS.IntegrationTests.Data.Aci.AciAnotherSample.XML"; using (var resourceContent = GetType().Assembly.GetManifestResourceStream(embededResourceName)) { if (resourceContent == null) throw new InvalidProgramException(String.Format("Resource {0} was not found!", embededResourceName)); int xmlId = target.ParseAciXml(resourceContent, orderId); var aciResults = target.AciXmlValidate(xmlId); //clean-up aciXmlRepository.Delete(xmlId); Assert.AreEqual(aciResults.Count, 50); } }