public async Task Insert_With_Sequential_Key(Type dataContextType) { // Arrange using IDataContext dataContext = DataContextTestHelper.SetupDataContext(dataContextType); // Act CitySequential city = await dataContext.Create(new CitySequential() { CityCode = "BRI", CityName = "Brighton" }); // Assert Assert.Greater(city.CityId, 0); Assert.AreEqual("BRI", city.CityCode); Assert.AreEqual("Brighton", city.CityName); }
public async Task Insert_With_Sequential_Key() { using (IDbConnection connection = LocalDbTestHelper.OpenTestConnection(TestContext.CurrentContext.Test.FullName)) { // Act CitySequential city = await connection.Create <CitySequential>(new CitySequential() { CityCode = "BRI", CityName = "Brighton" }).ConfigureAwait(false); // Assert Assert.Greater(city.CityId, 0); Assert.AreEqual("BRI", city.CityCode); Assert.AreEqual("Brighton", city.CityName); } }