示例#1
0
        public void Get_Tariff_Api_With_Max_Value_Result()
        {
            var controller = new TariffController();
            var tariffs    = controller.Get(10000000000000011102);

            Assert.IsType <OkObjectResult>(tariffs);
        }
示例#2
0
        public void Get_Tariff_Api_With_OK_Result()
        {
            var controller = new TariffController();
            var tariffs    = controller.Get(3500);

            Assert.IsType <OkObjectResult>(tariffs);
        }
        public TariffControllerTest()
        {
            LoggerMock    = new Mock <ILogger <TariffService> >();
            MappingConfig = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingProfile()); });
            Mapper        = MappingConfig.CreateMapper();

            ITariffService provider = new TariffService(Mapper, LoggerMock.Object);

            _controller = new TariffController(provider);
        }
示例#4
0
        public void Initialise()
        {
            _customerService = Substitute.For <ICustomerService>();
            _packageService  = Substitute.For <IPackageService>();
            _discountService = Substitute.For <IDiscountService>();
            _tariffService   = Substitute.For <ITariffService>();
            _accountsService = Substitute.For <IAccountsService>();

            _controller = new TariffController(_customerService, _accountsService, _packageService, _discountService,
                                               _tariffService);
            _customerService.GetAccount(Arg.Any <string>()).Returns(new CustomerAccount());
            _tariffService.GetTariffInfo(Arg.Any <string>()).Returns(new TariffInfo {
                Tariffs = new List <Tariff>()
            });
        }
示例#5
0
 public TariffControllerTests()
 {
     _mockTariffService = new Mock <ITariffService>();
     _controller        = new TariffController(_mockTariffService.Object);
 }