NiceLuc / Monolith-Utils

0 stars 0 forks source link

Add support for Guid? types in our stored procedure calls. #2

Closed NiceLuc closed 1 month ago

NiceLuc commented 1 month ago

This should be done as part of view model creation of the unit test methods.

Notice Here...

[TestMethod]
public void IC_RegisterDataConnector_HappyPath()
{
    // Assemble
    Guid? expectedGuid = Guid.NewGuid(); // <-- NOTICE!!

    _query.ConfigureNonQuery();
    _query.ConfigureOutputParameter("@ConnectorGuid", expectedGuid);
    var repository = CreateRepository();

    // Act
    Guid? actualGuid = Guid.NewGuid(); // <-- NOTICE!!
    repository.IC_RegisterDataConnector(1, 2, 3, "name", "version", DateTime.Now, ref actualGuid);

    // Assert
    _query.VerifySet(q => q.CommandType = CommandType.StoredProcedure);
    _query.VerifySet(q => q.SQL = "dbo.IC_RegisterDataConnector");
    Assert.AreEqual(expectedGuid, actualGuid);
    ValidateMocks();
}