public async void All()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var repository = new DestinationRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
        public void DeleteNotFound()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var repository = new DestinationRepository(loggerMoc.Object, context);

            Func <Task> delete = async() =>
            {
                await repository.Delete(default(int));
            };

            delete.Should().NotThrow();
        }
        public async void Create()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var repository = new DestinationRepository(loggerMoc.Object, context);

            var entity = new Destination();
            await repository.Create(entity);

            var record = await context.Set <Destination>().FirstOrDefaultAsync();

            record.Should().NotBeNull();
        }
        public async void Create()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var repository = new DestinationRepository(loggerMoc.Object, context);

            var entity = new Destination();

            entity.SetProperties(default(int), 1, "B", 2);
            await repository.Create(entity);

            var records = await context.Set <Destination>().ToListAsync();

            records.Count.Should().Be(2);
        }
        public async void Get()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var repository = new DestinationRepository(loggerMoc.Object, context);

            Destination entity = new Destination();

            context.Set <Destination>().Add(entity);
            await context.SaveChangesAsync();

            var record = await repository.Get(entity.Id);

            record.Should().NotBeNull();
        }
        public async void Delete()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var         repository       = new DestinationRepository(loggerMoc.Object, context);
            Destination entity           = new Destination();

            context.Set <Destination>().Add(entity);
            await context.SaveChangesAsync();

            await repository.Delete(entity.Id);

            Destination modifiedRecord = await context.Set <Destination>().FirstOrDefaultAsync();

            modifiedRecord.Should().BeNull();
        }
        public async void Update_Entity_Is_Not_Tracked()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var         repository       = new DestinationRepository(loggerMoc.Object, context);
            Destination entity           = new Destination();

            context.Set <Destination>().Add(entity);
            await context.SaveChangesAsync();

            await repository.Update(new Destination());

            var modifiedRecord = context.Set <Destination>().FirstOrDefaultAsync();

            modifiedRecord.Should().NotBeNull();
        }
        public async void Update_Entity_Is_Not_Tracked()
        {
            Mock <ILogger <DestinationRepository> > loggerMoc = DestinationRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = DestinationRepositoryMoc.GetContext();
            var         repository       = new DestinationRepository(loggerMoc.Object, context);
            Destination entity           = new Destination();

            entity.SetProperties(default(int), 1, "B", 2);
            context.Set <Destination>().Add(entity);
            await context.SaveChangesAsync();

            context.Entry(entity).State = EntityState.Detached;

            await repository.Update(entity);

            var records = await context.Set <Destination>().ToListAsync();

            records.Count.Should().Be(2);
        }