Пример #1
0
        public void ChangeType_InvalidBoardUserType_ThrowsInvalidOperationException()
        {
            var boardId   = 1;
            var userId    = "user-id";
            var type      = BoardUserType.Owner;
            var boardUser = new BoardUser(boardId, userId, type);

            void action() => boardUser.ChangeType((BoardUserType)1000);

            Assert.Throws <InvalidOperationException>(action);
        }
Пример #2
0
        public void ChangeType_UpdatesTypeValue()
        {
            var boardId   = 1;
            var userId    = "user-id";
            var type      = BoardUserType.Owner;
            var newType   = BoardUserType.Collaborator;
            var boardUser = new BoardUser(boardId, userId, type);

            boardUser.ChangeType(newType);

            Assert.Equal(newType, boardUser.Type);
        }