public void GetFormattedQueryStatementBody_WhenCalledWithUpdateQueryStatement_ShouldReturnUpdateFormattedQueryStatementBody() { //Arrange var expectedListOfProperties = new EntityPropertyProcessorResponse { Result = "Id=@Id, Name=@Name, Age=@Age", }; //Act var actual = EntityPropertyProcessor.GetFormattedQueryStatementBody <TestingObject>(QueryStatement.UpdateQuery); //Assert actual.Should().BeEquivalentTo(expectedListOfProperties); }
public void GetFormattedQueryStatementBody_WhenCalledWithInsertQueryStatement_ShouldReturnInsertFormattedQueryStatementBody() { //Arrange var expectedListOfProperties = new EntityPropertyProcessorResponse { Result = "(Id,Name,Age) values (@Id, @Name, @Age)" }; //Act var actual = EntityPropertyProcessor.GetFormattedQueryStatementBody <TestingObject>(QueryStatement.InsertQuery); //Assert actual.Should().BeEquivalentTo(expectedListOfProperties); }
public void GetFormattedQueryStatementBody_WhenCalledWithInsertQueryStatementAndPropertyNameToBeExcluded_ShouldReturnInsertFormattedQueryStatementBodyWithoutExcludedPropertyNames() { //Arrange var propertyToBeRemoved = "Id"; var expectedList = new EntityPropertyProcessorResponse { Result = "(Name,Age) values (@Name, @Age)" }; //Act var actual = EntityPropertyProcessor.GetFormattedQueryStatementBody <TestingObject>(QueryStatement.InsertQuery, propertyToBeRemoved); //Assert actual.Should().BeEquivalentTo(expectedList); }