public void TestDbCommandCreateParametersPropertyHandlerTypeLevelInvocationViaQueryGroup() { // Arrange var param = new QueryGroup(new QueryField("Id", Guid.Parse("9963c864-ab4f-43f8-9dc9-43038565b971"))); FluentMapper .Type <Guid>() .PropertyHandler <StringToGuidPropertyHandler>(); // Act using (var connection = new PropertyHandlerConnection()) { using (var cmd = connection.CreateCommand()) { cmd.CreateParameters(param); // Assert Assert.AreEqual(1, cmd.Parameters.Count); Assert.AreEqual("9963c864-ab4f-43f8-9dc9-43038565b971", cmd.Parameters[0].Value); } } }
public void TestDbCommandCreateParametersPropertyHandlerPropertyLevelInvocationViaClass() { // Arrange var param = new TestClass { Id = Guid.Parse("9963c864-ab4f-43f8-9dc9-43038565b971") }; FluentMapper .Entity <TestClass>() .PropertyHandler <StringToGuidPropertyHandler>(e => e.Id); // Act using (var connection = new PropertyHandlerConnection()) { using (var cmd = connection.CreateCommand()) { cmd.CreateParameters(param); // Assert Assert.AreEqual(1, cmd.Parameters.Count); Assert.AreEqual("9963c864-ab4f-43f8-9dc9-43038565b971", cmd.Parameters[0].Value); } } }