public void MembershipPostGetAccept()
        {
            var mockDb = new MockDatabase();
            BasicDb(mockDb);

            MembershipController controller = new MembershipController(mockDb);


            var membership = (controller.Accept(teamId: 1, userId: 2) as OkNegotiatedContentResult<Membership>).Content;
            var result = controller.Get(membership.Id) as OkNegotiatedContentResult<Membership>;
            Assert.IsNotNull(result);

            Assert.AreEqual(1, result.Content.TeamId);
            Assert.AreEqual(2, result.Content.AccountId);
            Assert.AreEqual(MembershipStatus.Member, result.Content.Status);
        }
        public void MembershipBan()
        {
            var mockDb = new MockDatabase();
            DoubleDb(mockDb);

            MembershipController controller = new MembershipController(mockDb);

            controller.BanMember(teamId: 1, toId: 2, fromId: 1);

            var result = controller.Get(2) as OkNegotiatedContentResult<Membership>;
            Assert.IsNotNull(result);

            Assert.AreEqual(1, result.Content.TeamId);
            Assert.AreEqual(2, result.Content.AccountId);
            Assert.AreEqual(MembershipStatus.Banned, result.Content.Status);
        }
        public void MembershipByAccount()
        {
            var mockDb = new MockDatabase();
            DoubleDb(mockDb);

            MembershipController controller = new MembershipController(mockDb);

            var result = controller.ByAccount(1) as OkNegotiatedContentResult<List<Membership>>;
            Assert.IsNotNull(result);

            Assert.IsTrue(result.Content.Select(t => t.TeamId).Contains(1));
        }
        public void MembershipGiveAndTakeModerator()
        {
            var mockDb = new MockDatabase();
            DoubleDb(mockDb);

            MembershipController controller = new MembershipController(mockDb);

            controller.GiveModeratorStatus(teamId: 1, toId: 2, fromId: 1);

            var result = controller.Get(2) as OkNegotiatedContentResult<Membership>;
            Assert.IsNotNull(result);

            Assert.AreEqual(1, result.Content.TeamId);
            Assert.AreEqual(2, result.Content.AccountId);
            Assert.AreEqual(MembershipStatus.Moderator, result.Content.Status);

            controller.RemoveModeratorStatus(teamId: 1, toId: 2, fromId: 1);

            result = controller.Get(2) as OkNegotiatedContentResult<Membership>;
            Assert.IsNotNull(result);

            Assert.AreEqual(1, result.Content.TeamId);
            Assert.AreEqual(2, result.Content.AccountId);
            Assert.AreEqual(MembershipStatus.Member, result.Content.Status);
        }