示例#1
0
        public async Task CreateInviteReturnsNew()
        {
            user = Auth.CurrentUser = await GetUser("[email protected]", Privilege.Admin);

            BoardExtensions.Board = await BoardExtensions.BoardLookup(services, "benefact");

            var rpc         = new BoardsInterface(services);
            var firstResult = await rpc.Invite(new CreateInviteRequest()
            {
                Privilege = (Privilege)7
            });

            Assert.IsNotNull(firstResult);
            var secondResult = await rpc.Invite(new CreateInviteRequest()
            {
                Privilege = (Privilege)3
            });

            Assert.AreNotEqual(firstResult, secondResult);
        }
示例#2
0
        public async Task PrivateBoardJoinSucceeds()
        {
            user = Auth.CurrentUser = await GetUser("*****@*****.**", Privilege.Admin);

            BoardExtensions.Board = await BoardExtensions.BoardLookup(services, "benefact");

            var rpc         = new BoardsInterface(services);
            var firstResult = await rpc.Invite(new CreateInviteRequest()
            {
                Privilege = (Privilege)7
            });

            Assert.IsNotNull(firstResult);
            user = Auth.CurrentUser = await GetUser("[email protected]", null);

            var joinResult = await rpc.Join(new JoinRequest()
            {
                Key = firstResult
            });

            Assert.AreEqual(7, (int)joinResult.Privilege);
        }