Exemple #1
0
        public async Task Check_GetNotExistRecordReturnsNull(int firstId, int secondId)
        {
            //Arrange
            var cls = new InMemoryAppDbContext();

            using (var context = cls.GetContextWithData())
            {
                IItemRelationRepository repo             = new ItemRelationRepository(context);
                ItemRelation            expectedRelation = context.ItemsRelations.Find(firstId, secondId);
                ItemRelation            actualRelation   = await repo.GetRecordAsync(firstId, secondId);

                Assert.Null(actualRelation);
                Assert.Equal(expectedRelation, actualRelation);
                context.Database.EnsureDeleted();
            }
        }