public async void Create()
        {
            Mock <ILogger <SalesOrderHeaderSalesReasonRepository> > loggerMoc = SalesOrderHeaderSalesReasonRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = SalesOrderHeaderSalesReasonRepositoryMoc.GetContext();
            var repository = new SalesOrderHeaderSalesReasonRepository(loggerMoc.Object, context);

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

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

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

            SalesOrderHeaderSalesReason entity = new SalesOrderHeaderSalesReason();

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

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

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

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

            await repository.Delete(entity.SalesOrderID);

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

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

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

            await repository.Update(new SalesOrderHeaderSalesReason());

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

            modifiedRecord.Should().NotBeNull();
        }