Ejemplo n.º 1
0
        public void EntityType_ReturnsCorrectlyComposedInsertQuery(object entityType, string primaryKeyName, string expectedQuery)
        {
            // Arrange
            var sqlServerQueryComposer = new SqlServerQueryComposer();

            // Act
            var deleteQuery = sqlServerQueryComposer.ComposeDelete(entityType.GetType(), primaryKeyName);

            // Assert
            Assert.AreEqual(expectedQuery, deleteQuery);
        }
Ejemplo n.º 2
0
        public void EntityType_ReturnsCorrectlyComposedInsertQuery(object entityType, string expectedQuery)
        {
            // Arrange
            var sqlServerQueryComposer = new SqlServerQueryComposer();

            // Act
            var selectQuery = sqlServerQueryComposer.ComposeSelect(entityType.GetType());

            // Assert
            Assert.AreEqual(expectedQuery, selectQuery);
        }
Ejemplo n.º 3
0
        public void EntityTypeAndSelectedProperties_ReturnsCorrectlyComposedInsertQueryContainingAllPropertiesExcludingThePrimaryKey(object entityType, string primaryKeyName, string expectedQuery)
        {
            // Arrange
            var sqlServerQueryComposer = new SqlServerQueryComposer();

            // Act
            var insertQuery = sqlServerQueryComposer.ComposeInsert(entityType.GetType(), primaryKeyName);

            // Assert
            Assert.AreEqual(expectedQuery, insertQuery);
        }