public void GetParameters_RecordWithSqlParameterAttributes_ParametersAreCreatedAsExpected() { var record = Person.Faker.Generate(1).Single(); var databaseWriterCommandParameterProvider = new DatabaseWriterCommandParameterProvider(); var parameters = databaseWriterCommandParameterProvider.GetParameters(record); DatabaseWriterCommandParameterProviderTests.AssertCommandParametersAreCreatedAsExpected(parameters, record); }
public void GetParameters_StaticParameters_StaticParametersAreReturned() { var person = Person.Faker.Generate(1).Single(); var record = new { person.FirstName, person.LastName, person.MiddleInitial, person.Age, person.DateOfBirth, person.Gender }; var staticParameters = DatabaseWriterCommandParameterProviderTests.CreateStaticParameters(record); var databaseWriterCommandParameterProvider = new DatabaseWriterCommandParameterProvider(staticParameters); var parameters = databaseWriterCommandParameterProvider.GetParameters(record); DatabaseWriterCommandParameterProviderTests.AssertCommandParametersAreCreatedAsExpected(parameters, record); }