public static Location CreateLocation(Guid id, string source, string site, string warehouse, string gate, string row, string position, string type, bool isRack)
            {
                // prepare
                var odataProvider = new Mock <ILocationOdataProvider>().Object;
                var config        = new MapperConfiguration(cfg =>
                {
                    cfg.AddProfile <DomainToClassProfile>();
                    cfg.AddProfile <ClassToDomainProfile>();
                });
                var mapper          = new Mapper(config);
                var writeRepository = new LocationWriteRepository(new DataContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)), mapper);
                var readRepository  = new LocationReadRepository(new DataContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)), odataProvider, mapper);

                // create
                var location = new Location(id, source, site, warehouse, gate, row, position, type, isRack);
                IEnumerable <Location> locations = new List <Location>()
                {
                    location
                };

                foreach (var item in locations)
                {
                    writeRepository.CreateAsync(item).GetAwaiter().GetResult();
                }

                // result

                return(location);
            }
            public static IEnumerable <Location> GetLocations()
            {
                var odataProvider = new Mock <ILocationOdataProvider>().Object;
                var config        = new MapperConfiguration(cfg =>
                {
                    cfg.AddProfile <DomainToClassProfile>();
                    cfg.AddProfile <ClassToDomainProfile>();
                });
                var mapper     = new Mapper(config);
                var repository = new LocationReadRepository(new DataContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)), odataProvider, mapper);
                var result     = repository.ListAsync(null, null, null).Result;

                return(result);
            }