Beispiel #1
0
        public static void SetReservedProviderInfoForTests(TestContext testContext)
        {
            ADMIN_USER = new User("Brulu", ADMIN_USER_USEREMAIL, "HOLA1234", AdminRole.GetInstance());
            List <IField> emptyFields = new List <IField>();
            TextField     field       = new TextField("NumeroCliente");

            emptyFields.Add(field);
            DESIGNED_PROVIDER = new Provider("Apple", 3, emptyFields);
            ProvidersController providerController = new ProvidersController(ADMIN_USER.Email);

            providerController.PostProvider(DESIGNED_PROVIDER);
            IHttpActionResult actionResultProvider = providerController.GetProviders();
            OkNegotiatedContentResult <IEnumerable <Provider> > contentResult = (OkNegotiatedContentResult <IEnumerable <Provider> >)actionResultProvider;
            IEnumerable <Provider> providers = contentResult.Content;

            foreach (Provider provider in providers)
            {
                if (provider.Name.Equals(DESIGNED_PROVIDER.Name))
                {
                    DESIGNED_PROVIDER.ID = provider.ID;
                }
            }
            providerController.Dispose();
            FIRST_PAYMENT  = CreateFirstPayment();
            SECOND_PAYMENT = CreateNewRandomPayment();
            CONTROLLER     = new PaymentsController(ADMIN_USER_USEREMAIL);
            CONTROLLER.PostPayment(FIRST_PAYMENT);
            CONTROLLER.PostPayment(SECOND_PAYMENT);
            CONTROLLER.Dispose();
        }
Beispiel #2
0
 public void FinalizeTest()
 {
     CONTROLLER.Dispose();
 }