-
Notifications
You must be signed in to change notification settings - Fork 516
Expand file tree
/
Copy pathCustomerMustBeSmallerThanMaximumHeightLimitRuleTests.cs
More file actions
40 lines (32 loc) · 1.38 KB
/
CustomerMustBeSmallerThanMaximumHeightLimitRuleTests.cs
File metadata and controls
40 lines (32 loc) · 1.38 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
namespace EvolutionaryArchitecture.Fitnet.Contracts.Core.UnitTests.PrepareContract.BusinessRules;
using Common.Core.BusinessRules;
using Core.PrepareContract.BusinessRules;
public sealed class CustomerMustBeSmallerThanMaximumHeightLimitRuleTests
{
[Fact]
internal void Given_customer_height_which_is_greater_than_maximum_height_limit_Then_validation_should_throw()
{
// Arrange
const int height = 211;
// Act & Assert
var exception = Should.Throw<BusinessRuleValidationException>(() =>
BusinessRuleValidator.Validate(new CustomerMustBeSmallerThanMaximumHeightLimitRule(height)));
exception.Message.ShouldBe("Customer height must fit maximum limit for gym instruments");
}
[Fact]
internal void Given_customer_height_which_is_equal_to_maximum_height_limit_Then_validation_should_pass()
{
// Arrange
const int height = 210;
// Act & Assert
Should.NotThrow(() => BusinessRuleValidator.Validate(new CustomerMustBeSmallerThanMaximumHeightLimitRule(height)));
}
[Fact]
internal void Given_customer_height_which_is_less_than_maximum_height_limit_Then_validation_should_pass()
{
// Arrange
const int height = 209;
// Act & Assert
Should.NotThrow(() => BusinessRuleValidator.Validate(new CustomerMustBeSmallerThanMaximumHeightLimitRule(height)));
}
}