-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBadRequestExceptionTests.cs
More file actions
50 lines (42 loc) · 1.28 KB
/
BadRequestExceptionTests.cs
File metadata and controls
50 lines (42 loc) · 1.28 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Net;
using FluentAssertions;
using IPData.Exceptions;
using Xunit;
namespace IPData.Tests.Exceptions
{
public class BadRequestExceptionTests
{
[Fact]
public void BadRequestException_WhenCreate_ShouldReturnStatusCode()
{
// Act
var sut = new BadRequestException();
// Assert
sut.StatusCode.Should().Be(HttpStatusCode.BadRequest);
}
[Fact]
public void BadRequestException_WhenCreateWithoutParams_ShouldReturnApiError()
{
// Act
var sut = new BadRequestException();
// Assert
sut.ApiError.Should().NotBeNull();
}
[Theory, AutoMoqData]
public void BadRequestException_WhenCreateWithContent_ShouldReturnApiErrorWithMessage(string content)
{
// Act
var sut = new BadRequestException(content);
// Assert
sut.ApiError.Message.Should().Be(content);
}
[Theory, AutoMoqData]
public void BadRequestException_WhenCreateWithContent_ShouldBeMessage(string content)
{
// Act
var sut = new BadRequestException(content);
// Assert
sut.Message.Should().Be(content);
}
}
}