[TestInitialize]//Initializes data required for each test and runs once per test method. public void InitializeData() { //Arrange accountInfo = new AccountInfo(); XmlReader xmlReader = XmlReader.Create(@"..\XMLTestFiles\TPA_500.xml"); var tpa = new TPAScaffold(); var serializer = new XmlSerializer(tpa.GetType()); input = (TPAScaffold)serializer.Deserialize(xmlReader); tpaController = new TaxProfileAssistantController(); tpaController.ControllerContext = new ControllerContext(); string resultstr = tpaController.Post(input); string key = resultstr.Substring(38); key = key.Replace(Constants.APPLICATION_URL_DUMMY_TEXT, "/"); accountInfo = AvaTaxProfileAssistantHelper.GetAccountInfoBySecureKey(key); credentialsController = new CredentialsController(); }
public CredentialsControllerFixture() { _sutBuilder = new CredentialsControllerBuilder(); _credentialVmComparer = new CredentialVmComparer(new RoleVmComparer()); _resourceStore = new ResourceStoreBuilder() .WithDefaultResources() .Build(); _roleStore = new RoleStoreBuilder(_resourceStore) .WithDefaultRoles() .Build(); _credentialStore = new CredentialStoreBuilder(_roleStore) .WithDefaultCredentials() .Build(); _sut = new CredentialsController(_roleStore, _resourceStore, _credentialStore); }