Пример #1
0
        public void GetUserNameReturnsUserNameForAValidSession()
        {
            Mock.Get(sessionMock).Setup(_sessionMock => _sessionMock.RetrieveFromCache(testSessionToken)).Returns("johndoe").Verifiable();

            manager.Initialise();

            string result = manager.GetUserName(testSessionToken);

            Assert.AreEqual("johndoe", result);
        }
        public void GetUserNameReturnsUserNameForAValidSession()
        {
            Expect.Call(sessionMock.RetrieveFromCache(testSessionToken)).Return("johndoe");

            mocks.ReplayAll();
            manager.Initialise();

            string result = manager.GetUserName(testSessionToken);

            Assert.AreEqual("johndoe", result);
        }