public void Test_GetStoresStrings() { var options = new DbContextOptionsBuilder <StoreContext>() .UseInMemoryDatabase(databaseName: "TestDb12") .Options; using (var context = new StoreContext(options)) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); StoreRepository storeRepo = new StoreRepository(context); StoreLogic sl = new StoreLogic(storeRepo); AStore store1 = new AStore(); store1.Name = "Store1"; AStore store2 = new AStore(); store2.Name = "Store2"; context.Add <AStore>(store1); context.Add <AStore>(store2); context.SaveChanges(); Dictionary <string, Guid> stores = sl.GetStoresStrings(); Assert.Equal(store1.StoreID, stores[store1.Name]); } }
public Dictionary <string, Guid> Get() { Dictionary <string, Guid> stores = storeLogic.GetStoresStrings(); return(stores); }