Ejemplo n.º 1
0
        public void TestSqLiteConnectionUpdateAsyncViaTableNameAsExpandoObjectViaDataEntity()
        {
            using (var connection = new SqliteConnection(Database.ConnectionStringMDS))
            {
                // Setup
                Database.CreateMdsCompleteTables(1, connection).First();
                var table = Helper.CreateMdsCompleteTablesAsExpandoObjects(1).First();

                // Act
                var result = DbConnectionExtension.UpdateAsync(connection, ClassMappedNameCache.Get <MdsCompleteTable>(),
                                                               table).Result;

                // Assert
                Assert.AreEqual(1, result);

                // Act
                var queryResult = connection.Query(ClassMappedNameCache.Get <MdsCompleteTable>(), result).First();

                // Assert
                Helper.AssertMembersEquality(queryResult, table);
            }
        }