public void GetValueFromStorePerformance() { //SETUP var options = this.CreateUniqueClassOptions <ExtraAuthorizeDbContext>(); using (var context = new ExtraAuthorizeDbContext(options, null)) { context.Database.EnsureCreated(); context.AddUpdateValue("test", (long)1234); context.SaveChanges(); const int numTimes = 1000; //ATTEMPT using (new TimeThings(_output, "EFCore - startup", 10)) { for (int i = 0; i < 10; i++) { var result = context.GetValueFromStore("test"); } } using (new TimeThings(_output, "EFCore", numTimes)) { for (int i = 0; i < numTimes; i++) { var result = context.GetValueFromStore("test"); } } using (new TimeThings(_output, "EFCore", numTimes)) { for (int i = 0; i < numTimes; i++) { var result = context.GetValueFromStore("test"); } } } }
public void TestGetValueFromStoreNoContent() { //SETUP var options = SqliteInMemory.CreateOptions <ExtraAuthorizeDbContext>(); using (var context = new ExtraAuthorizeDbContext(options, null)) { context.Database.EnsureCreated(); //ATTEMPT var result = context.GetValueFromStore("test"); //VERIFY result.ShouldBeNull(); } }
public void TestGetValueFromStore() { //SETUP var options = SqliteInMemory.CreateOptions <ExtraAuthorizeDbContext>(); using (var context = new ExtraAuthorizeDbContext(options, null)) { context.Database.EnsureCreated(); context.AddUpdateValue("test", (long)1234); context.SaveChanges(); //ATTEMPT var result = context.GetValueFromStore("test"); //VERIFY result.ShouldEqual((long)1234); } }