public ControllerTests() { var mock = new Mock <IUnitOfWork>(); mock.Setup(unit => unit.Aviators.GetAll()).Returns(GetTestAviators()); service = new AviatorService(mock.Object); MapperInitializator.Initialize(); }
private async void Initialize() { var mock = new Mock <IUnitOfWork>(); mock.Setup(unit => unit.Aviators.GetAll().Result).Returns(GetTestAviators()); service = new AviatorService(mock.Object); MapperInitializator.Initialize(); }
private static void Initialize() { var connectionString = @"Server=(localdb)\mssqllocaldb;Database=AirportDB;Trusted_Connection=True;"; var options = new DbContextOptionsBuilder <AirportContext>(); options.UseSqlServer(connectionString); context = new AirportContext(options.Options); unit = new UnitOfWork(context); service = new AviatorService(unit); MapperInitializator.Initialize(); }
public AviatorsController(AviatorService aviatorService) { this.aviatorService = aviatorService; }