Exemplo n.º 1
0
        public async Task GetTodo_NoToken_Unauthorized()
        {
            // Arrange
            var todoToFind = MockTodos.Get(14);
            var path       = $"{Routes.TodoRoute}/{todoToFind.Id}";

            // Act
            var response = await _endSystems.Get(path);

            // Assert
            Assert.Equal(HttpStatusCode.Unauthorized, response.Code);

            // Tear down
            _endSystems.Dispose();
        }
Exemplo n.º 2
0
        public async Task GetUserById_NoToken_Unauthorized()
        {
            // Arrange
            var userToFind = MockApplicationUsers.Get(4);
            var path       = $"{Routes.UserRoute}/{userToFind.Id}";

            // Act
            var response = await _endSystems.Get(path);

            // Assert
            Assert.Equal(HttpStatusCode.Unauthorized, response.Code);

            // Tear down
            _endSystems.Dispose();
        }
Exemplo n.º 3
0
        public async Task PostAccountLogin_InvalidContentType_UnsupportedMediaType()
        {
            // Arrange
            var content = new StringContent("Home is where I want to be Pick me up and turn me around I feel numb, born with a weak heart I guess I must be having fun");
            var path    = $"{Routes.AccountRoute}/login";

            // Act
            var response = await _endSystems.Post(path, content, "application/text");

            // Assert
            Assert.Equal(HttpStatusCode.UnsupportedMediaType, response.Code);

            // Tear down
            _endSystems.Dispose();
        }