public void WhenSetUserTypeWithUnathorizedUser_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, AccountUserTypeHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                var request = client.CreateAccountUserTypeRequest();

                // Act
                bool ok = request.SetUserTypeAsync(new Models.Accounts.UserTypeModel { Id = 25 }).Result;

                // Assert
                Assert.False(ok);
            }
        }
        public void WhenSetUserTypeWithUnathorizedUser_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, AccountUserTypeHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                var request = client.CreateAccountUserTypeRequest();

                // Act
                bool ok = request.SetUserTypeAsync(new Models.Accounts.UserTypeModel {
                    Id = 25
                }).Result;

                // Assert
                Assert.False(ok);
            }
        }
        public void WhenSetUserType_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, AccountUserTypeHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                client.AuthorizeAsync("test", "password").Wait();

                var request = client.CreateAccountUserTypeRequest();

                // Act
                bool ok = request.SetUserTypeAsync(new Models.Accounts.UserTypeModel { Id = 25 }).Result;

                // Assert
                Assert.True(ok);
                Assert.Equal("{\"Id\":25,\"Name\":null,\"Label\":null}", requestContent);
            }
        }
        public void WhenListAllUserTypes_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, AccountUserTypeHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);
                var request = client.CreateAccountUserTypeRequest();

                // Act
                var userTypes = request.ListAllUserTypesAsync().Result;

                // Assert
                Assert.NotNull(userTypes);
                Assert.NotEmpty(userTypes);
                Assert.Equal(25, userTypes.First().Id);
                Assert.Equal("Traducteur", userTypes.First().Label);
                Assert.Equal("Traducteur", userTypes.First().Name);
            }
        }
        public void WhenListAllUserTypes_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, AccountUserTypeHandler))
            {
                var client  = new YouScribeClient(TestHelpers.BaseUrl);
                var request = client.CreateAccountUserTypeRequest();

                // Act
                var userTypes = request.ListAllUserTypesAsync().Result;

                // Assert
                Assert.NotNull(userTypes);
                Assert.NotEmpty(userTypes);
                Assert.Equal(25, userTypes.First().Id);
                Assert.Equal("Traducteur", userTypes.First().Label);
                Assert.Equal("Traducteur", userTypes.First().Name);
            }
        }
        public void WhenSetUserType_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, AccountUserTypeHandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                client.AuthorizeAsync("test", "password").Wait();

                var request = client.CreateAccountUserTypeRequest();

                // Act
                bool ok = request.SetUserTypeAsync(new Models.Accounts.UserTypeModel {
                    Id = 25
                }).Result;

                // Assert
                Assert.True(ok);
                Assert.Equal("{\"Id\":25,\"Name\":null,\"Label\":null}", requestContent);
            }
        }