Ejemplo n.º 1
0
        public async Task ServiceProvider_ShouldCreateNewServiceProviderAsync()
        {
            // Assemble
            var context = new ApplicationContext(DbAssembly().Options);
            var serviceProviderController = new ServiceProviderController(context, new AppointmentBookingService());
            var serviceProvider           = (new ServiceProvider());

            // Act
            await serviceProviderController.Create(serviceProvider);

            // Assert
            Assert.NotEmpty(context.ServiceProviders);
        }
Ejemplo n.º 2
0
        public void ServiceProvider_ShouldAddNewServiceProvider()
        {
            // Assemble
            var mockRepository  = new MyMockedRepository();
            var serviceProvider = new ServiceProvider
            {
                FirstName = "Jane",
                LastName  = "Doe"
            };
            ServiceProviderController controller = new ServiceProviderController(mockRepository);

            // Act
            controller.Create(serviceProvider);

            // Assert
            Assert.NotEmpty(mockRepository.ServiceProviders);
        }