Hi,
I'm able to get further, but still have issues.
I've attached the test code.
I'm experiencing some peculiar behavior on Asserts, that simply could be me not understanding how the assertations should work or my "Arrange" working.
The InstanceIdSetTest in the attached code passes, but the InstanceIdGetTest fails the Assert, but when I check the values they are equal in debug when I hover over the values, but throw the below:
Expected string length 1 but was 0. Strings differ at index 0.
Expected: "1"
But was: <string.Empty>
-----------^
at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
at NUnit.Framework.Assert.AreEqual(Object expected, Object actual)
at UnitTests.SessionState.SessionRepositoryTest.InstanceIdGetTest() in C:ProjectsUnitTestsSessionStateSessionRepositoryTest.cs:line 54
at TypeMock.MockManager.getReturn(Object context, String typeName, String methodName, Object methodGenericParams, Boolean isDecorated, Boolean isInterceptedType, Object[] methodArguments)
at Typemock.Interceptors.Profiler.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
at UnitTests.SessionState.SessionRepositoryTest.InstanceIdGetTest() in C:ProjectsUnitTestsSessionStateSessionRepositoryTest.cs:line 52
PutInSessionTest & RemoveFromSessionTest, any idea how I can verify assert if they executed once?
System.InvalidOperationException : HttpContext.Current is not available, and is null
at SessionState.SessionRepository.PutInSession(String key, Object val) in C:ProjectsSessionStateSessionRepository.cs:line 53
at UnitTests.SessionState.SessionRepositoryTest.PutInSessionTest() in C:ProjectsSessionStateSessionRepositoryTest.cs:line 62
at TypeMock.MockManager.getReturn(Object context, String typeName, String methodName, Object methodGenericParams, Boolean isDecorated, Boolean isInterceptedType, Object[] methodArguments)
at Typemock.Interceptors.Profiler.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
at SessionState.SessionRepositoryTest.PutInSessionTest() in C:ProjectsUnitTestsSessionStateSessionRepositoryTest.cs:line 60
Also, GetFromSessionTest as the i'm getting the correct value back from the fake, but it fails the Assert even if they are equal.
Any suggestions on how to approach the above?
Thanks,
Omar
SessionRepositoryTest.zip