Ejemplo n.º 1
0
        public async Task should_return_record_by_id(string guid)
        {
            DbContextOptions <ERPContext> options = new DbContextOptionsBuilder <ERPContext>()
                                                    .UseInMemoryDatabase(databaseName: "should_return_record_by_id")
                                                    .Options;

            await using TestERPContext context = new TestERPContext(options);
            context.Database.EnsureCreated();

            ItemRespository sut    = new ItemRespository(context);
            Item            result = await sut.GetAsync(new Guid(guid));

            result.Id.ShouldBe(new Guid(guid));
        }
Ejemplo n.º 2
0
 public ItemRespositoryTests(ERPContextFactory catlogContextFactory)
 {
     _context         = catlogContextFactory.ContextInstance;
     _itemRespository = new ItemRespository(_context);
 }