示例#1
0
        public void ProcessMessageAllowsAnonymousCommandsForUncachedUsers()
        {
            var result = CommandManager.ProcessMessage("Unrestricted", "Uncached");

            Assert.IsTrue(result.Processed);
            Assert.IsTrue(result.Responses.Any());
            AnonymousExecutorMock.Verify(x => x(It.IsAny <string>()), Times.Once());
        }
示例#2
0
        public void ProcessMessageDoesNotAllowRestrictedAnonymousCommandsForUncachedUsers()
        {
            UserRoles[0].AddCommand("CommandMock.Unrestricted");
            var result = CommandManager.ProcessMessage("Unrestricted", "Uncached");

            Assert.IsTrue(result.Processed);
            Assert.IsTrue(result.Responses.Any());
            AnonymousExecutorMock.Verify(x => x(It.IsAny <string>()), Times.Never());
        }