public DbInitializeTest(
     ITestOutputHelper output,
     ContextFixture ctxFixture)
 {
     this.output  = output;
     this.context = ctxFixture.context;
 }
示例#2
0
        public CourseRepositoryTest(
            ITestOutputHelper output,
            ContextFixture ctxFixture)
        {
            this.output = output;
            context     = ctxFixture.context;
            var mock = new Mock <ILogger <CourseRepository> >();

            logger = mock.Object;
        }
示例#3
0
 public OrderRepositoryTest(
     ContextFixture contextFixture,
     AutoMapperFixture autoMapperFixture,
     ProductFixture productPrototype,
     CustomerFixture customerPrototype,
     OrderFixture orderPrototype)
     : base(contextFixture, autoMapperFixture)
 {
     _productPrototype  = productPrototype;
     _customerPrototype = customerPrototype;
     _orderPrototype    = orderPrototype;
 }
示例#4
0
 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();
 }
示例#5
0
        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();
        }
示例#6
0
 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();
 }
示例#7
0
        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();
        }
示例#8
0
        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);
        }
示例#9
0
 public Add(ContextFixture fixture) : base(fixture)
 {
 }
示例#10
0
 public EventsServiceTests(ContextFixture contextFixture, DbSetFixture dbSetFixture, RepositoryFixture repositoryFixture, AppSettingsFixture settingsFixture)
 {
     _contextFixture  = contextFixture;
     _dbSetFixture    = dbSetFixture;
     _settingsFixture = settingsFixture;
 }
示例#11
0
 public ProductRepositoryTest(ContextFixture contextFixture, AutoMapperFixture autoMapperFixture)
     : base(contextFixture, autoMapperFixture)
 {
 }
示例#12
0
 public BaseRepositoryTest(ContextFixture contextFixture, AutoMapperFixture autoMapperFixture)
 {
     ContextFixture = contextFixture;
     MapperFixture  = autoMapperFixture;
 }
示例#13
0
 private void InitializeDataBase(FTStoreDbContext context)
 {
     ContextFixture.InitializeWithOneCustomer(context);
     ContextFixture.InitializeWithOneProduct(context);
     ContextFixture.InitializeWithOnePaymentMethod(context);
 }
示例#14
0
 public Count(ContextFixture fixture) : base(fixture)
 {
 }
示例#15
0
 public List(ContextFixture fixture) : base(fixture)
 {
 }