Exemple #1
0
            public async void Should_AddAsync_Valid()
            {
                await using var context = new TestContext(ContextOptions);
                var repository = new BillingsRepository(
                    new Mock <ILogger <AbstractRepository <BillingsContext, BillingEntity> > >().Object,
                    context
                    );
                var newEntity = new BillingEntity();
                var result    = await repository.AddAsync(newEntity);

                Assert.NotNull(result);
            }
Exemple #2
0
            public async void Should_GetOneByParameterAsync_Valid()
            {
                await using var context = new TestContext(ContextOptions);
                var repository = new BillingsRepository(
                    new Mock <ILogger <AbstractRepository <BillingsContext, BillingEntity> > >().Object,
                    context
                    );
                var newEntity = new BillingEntity {
                    Version = 99
                };
                var _ = await repository.AddAsync(newEntity);

                var result = await repository.GetOneByParameterAsync(
                    e => e.Version == 99
                    );

                Assert.NotNull(result);
            }