コード例 #1
0
        public void SetUp()
        {
            authenticationMock = mocks.Create <IAuthentication>().Object;
            Mock.Get(authenticationMock).SetupGet(_authenticationMock => _authenticationMock.Identifier).Returns("johndoe");
            sessionMock = mocks.Create <ISessionCache>().Object;

            manager       = new InternalSecurityManager();
            manager.Users = new IAuthentication[] {
                authenticationMock
            };
            manager.SessionCache = sessionMock;
        }
コード例 #2
0
        public void SetUp()
        {
            authenticationMock = mocks.DynamicMock <IAuthentication>();
            SetupResult.For(authenticationMock.Identifier).Return("johndoe");
            sessionMock = mocks.DynamicMock <ISessionCache>();

            manager       = new InternalSecurityManager();
            manager.Users = new IAuthentication[] {
                authenticationMock
            };
            manager.SessionCache = sessionMock;
        }