Beispiel #1
0
        public async Task <IActionResult> GenerateMockData()
        {
            MockData mockData = new MockData(_bookRepo);
            await mockData.CreateMockData();

            return(RedirectToAction("Index", "Home"));
        }
Beispiel #2
0
 static SenderControllerTests()
 {
     MockData.CreateMockData(DbMock);
     DbMock.Senders.Add(new Sender {
         SenderId = IdOfSenderWithoutSendings
     });
 }
Beispiel #3
0
 public void SetUp()
 {
     DbMock = new ApplicationDbContextMock();
     MockData.CreateMockData(DbMock);
     patientController = new PatientController(DbMock);
     sendingController = new SendingController(DbMock);
     foreach (var sending in DbMock.Sendings)
     {
         sending.Isolate = MockData.CreateInstance <Isolate>();
         sending.Isolate.EpsilometerTests.Clear();
         sending.Isolate.EpsilometerTests.Add(MockData.CreateInstance <EpsilometerTest>());
     }
 }
Beispiel #4
0
        public void Setup()
        {
            MockData.CreateMockData();
            _agileMapper   = new AgileMapperLibrary.Mapper();
            _expressMapper = new ExpressMapperLibrary.Mapper();
            _mapsterMapper = new MapsterLibrary.Mapper();

            AutoMapper.MapperConfiguration config = new AutoMapper.MapperConfiguration(cfg =>
            {
                cfg.CreateMap <Customer, CustomerDto>();
                cfg.CreateMap <Address, AddressDto>();
            });

            _autoMapper = new AutoMapper.Mapper(config);
        }
Beispiel #5
0
        public void Setup()
        {
            _database = new ApplicationDbContextMock();
            MockData.CreateMockData(_database);

            for (int i = 0; i < 5; i++)
            {
                var isolate = MockData.CreateInstance <MeningoIsolate>();
                var sending = MockData.CreateInstance <MeningoSending>();
                sending.SamplingDate            = i == 3 ? null : (DateTime?)_firstDayMorning.AddDays(i).AddHours(8);
                sending.ReceivingDate           = _firstDayMorning.AddDays(i).AddHours(8);
                isolate.Sending                 = sending;
                isolate.StemNumber              = i == 4 ? null : (int?)i + 1;
                isolate.NeisseriaPubMlstIsolate = null;
                _database.MeningoIsolates.Add(isolate);
            }

            _pubMlstService = Substitute.For <PubMlstService>();
        }
Beispiel #6
0
 internal SendingController CreateMockSendingController()
 {
     DbMock = new ApplicationDbContextMock();
     MockData.CreateMockData(DbMock);
     return(new SendingController(DbMock));
 }