public void Bad_URL_Handled_And_Logged()
        {
            _logger  = new Mock <ILogger <SpaceXOriginalService> >();
            _service = new SpaceXOriginalService(_logger.Object, _settings);

            _settings.URL = "asdfasdfasdf";
            _service.GetLaunchPads();

            _logger.Verify(l => l.Log(LogLevel.Error, 0, It.IsAny <FormattedLogValues>(), It.IsAny <Exception>(),
                                      It.IsAny <Func <object, Exception, string> >()));
        }
 public LaunchPadController(ISpaceXService service, ILogger <LaunchPadController> logger)
 {
     _service = service;
     _logger  = logger;
 }
 public LaunchPadServiceTests()
 {
     _settings = new SpaceXSettings();
     _logger   = new Mock <ILogger <SpaceXOriginalService> >();
     _service  = new SpaceXOriginalService(_logger.Object, _settings);
 }
Beispiel #4
0
 public LaunchPadControllerTests()
 {
     _service    = new SpaceXServiceFake();
     _logger     = new Mock <ILogger <LaunchPadController> >();
     _controller = new LaunchPadController(_service, _logger.Object);
 }