public DbInitializeTest( ITestOutputHelper output, ContextFixture ctxFixture) { this.output = output; this.context = ctxFixture.context; }
public CourseRepositoryTest( ITestOutputHelper output, ContextFixture ctxFixture) { this.output = output; context = ctxFixture.context; var mock = new Mock <ILogger <CourseRepository> >(); logger = mock.Object; }
public OrderRepositoryTest( ContextFixture contextFixture, AutoMapperFixture autoMapperFixture, ProductFixture productPrototype, CustomerFixture customerPrototype, OrderFixture orderPrototype) : base(contextFixture, autoMapperFixture) { _productPrototype = productPrototype; _customerPrototype = customerPrototype; _orderPrototype = orderPrototype; }
public Update(ContextFixture fixture) : base(fixture) { _speaker = new Speaker { Id = new Guid("5FD2E324-A935-484E-8F9F-F52E7921EF21"), Name = "Test Speaker", Slug = "test-speaker", Location = "Tampa, FL", Description = "Test Speaker from Tampa, FL" }; Context.Speakers.Add(_speaker); Context.SaveChanges(); }
public Get(ContextFixture fixture) : base(fixture) { _id = Guid.NewGuid(); Context.Speakers.Add(new Speaker { Id = _id, Name = "Test Speaker", Slug = "test-speaker", Location = "Tampa, FL", Description = "Test Speaker from Tampa, FL" }); Context.SaveChanges(); }
public Delete(ContextFixture fixture) : base(fixture) { _speaker = new Speaker { Id = new Guid("D6012CB6-6184-4AB4-BE14-B29C61F2CB32"), Name = "Test Speaker", Slug = "test-speaker", Location = "Tampa, FL", Description = "Test Speaker from Tampa, FL" }; Context.Speakers.Add(_speaker); Context.SaveChanges(); }
public override void ShouldDeleteByEntityReference() { using var context = ContextFixture.Ctx; InitializeDataBase(context); ContextFixture.InitializeWithOneOrder(context); Order orderEntity = new Order(DateTime.Now, null, DateTime.Now, null, null); orderEntity.DefineId(ID); var repository = new OrderRepository(context, MapperFixture.Mapper); repository.Remove(orderEntity); context.Orders.Should().BeEmpty(); }
public override void ShouldUpdate() { using var context = ContextFixture.Ctx; var repository = new OrderRepository(context, MapperFixture.Mapper); InitializeDataBase(context); ContextFixture.InitializeWithOneOrder(context); var order = repository.GetById(ID); var newDeliveryForecast = order.DeliveryForecast.AddDays(10); order.DefineNewDeliveryForecast(newDeliveryForecast); repository.Update(order); var modifiedOrder = repository.GetById(ID); modifiedOrder.DeliveryForecast.Should().Be(newDeliveryForecast); }
public Add(ContextFixture fixture) : base(fixture) { }
public EventsServiceTests(ContextFixture contextFixture, DbSetFixture dbSetFixture, RepositoryFixture repositoryFixture, AppSettingsFixture settingsFixture) { _contextFixture = contextFixture; _dbSetFixture = dbSetFixture; _settingsFixture = settingsFixture; }
public ProductRepositoryTest(ContextFixture contextFixture, AutoMapperFixture autoMapperFixture) : base(contextFixture, autoMapperFixture) { }
public BaseRepositoryTest(ContextFixture contextFixture, AutoMapperFixture autoMapperFixture) { ContextFixture = contextFixture; MapperFixture = autoMapperFixture; }
private void InitializeDataBase(FTStoreDbContext context) { ContextFixture.InitializeWithOneCustomer(context); ContextFixture.InitializeWithOneProduct(context); ContextFixture.InitializeWithOnePaymentMethod(context); }
public Count(ContextFixture fixture) : base(fixture) { }
public List(ContextFixture fixture) : base(fixture) { }