aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/IntegratedTests/UnknownEndpointTest.cs
blob: 40f818a774681d17f97ae059a2454900f9029f46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using FluentAssertions;
using Microsoft.AspNetCore.Mvc.Testing;
using System.Threading.Tasks;
using Timeline.Models.Http;
using Timeline.Tests.Helpers;
using Xunit;

namespace Timeline.Tests.IntegratedTests
{
    public class UnknownEndpointTest : IntegratedTestBase
    {
        public UnknownEndpointTest(WebApplicationFactory<Startup> factory) : base(factory)
        {
        }

        [Fact]
        public async Task UnknownEndpoint()
        {
            using var client = await CreateDefaultClient();
            var res = await client.GetAsync("unknownEndpoint");
            res.Should().HaveStatusCode(400)
                .And.HaveCommonBody()
                .Which.Code.Should().Be(ErrorCodes.Common.UnknownEndpoint);
        }
    }
}