I have a unit test that I was expecting to pass, but it doesn't. It almost feels like there are two instances of the CommentResponse object. One with the value from the database, and one that was changed to string.empty. I havn't tried it with 2.03.
Anyone see a bonehead mistake in the code?
<Test()> _
Public Sub ChangeProperty() Dim testEval As Evaluation = Evaluation.GetEvaluation(_eval.EvaluationID) For Each r As AbstractResponse In _eval.Responses If r.QuestionID = _commentQuestion.QuestionID Then_commentResponseID =
CType(r, CommentResponse).ResponseID CType(r, CommentResponse).Comment = String.Empty End If NextAssert.AreEqual(
String.Empty, CType(testEval.Responses.GetItem(_commentResponseID), CommentResponse).Comment) End SubPublic
Function GetItem(ByVal ResponseID As Integer) As IResponse For Each r As AbstractResponse In Me If r.ResponseID = ResponseID Then Return r End If Next Return Nothing End Function
UnitTest Result:
EPAS.BusinessObjects.UnitTests.ResponseTestFixtures.CommmentResponseFixture.ChangeProperty :
String lengths differ. Expected length=0, but was length=4.
Strings differ at index 0.
expected: <"">
but was: <"Test">
------------^
Bonehead it is!
Thanks you for the help.
Jeff
Copyright (c) Marimer LLC