protected ProxyService GetService() { var configLocation = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/Configuration.json"); var configurationRepo = new ConfigurationRepository(configLocation); var employeeIdentityRespository = new EmployeeIdentityRepository(); var requestTypeResolver = new RequestTypeResolver(); var hmrcDataManipulator = new HmrcDataManipulator(employeeIdentityRespository, requestTypeResolver); var messageSender = new MessageSender(); return new ProxyService(hmrcDataManipulator, configurationRepo, messageSender); }
public void HmrcDataFileIsNotManipulatedForRequestTypeOf(RequestType requestType) { var testData = TestResponses.P9Response; var repository = new EmployeeIdentityRepository(); var requestTypeResolver = new FakeRequestTypeResolver(); requestTypeResolver.SetRequestType(requestType); var manipulator = new HmrcDataManipulator(repository, requestTypeResolver); var alteredData = manipulator.ApplyEmployeeIdentities(testData, new IdentityCache()); Assert.AreEqual(testData, alteredData); }