-
Notifications
You must be signed in to change notification settings - Fork 516
Expand file tree
/
Copy pathPreviousContractHasToBeSignedRuleTests.cs
More file actions
27 lines (22 loc) · 1.08 KB
/
PreviousContractHasToBeSignedRuleTests.cs
File metadata and controls
27 lines (22 loc) · 1.08 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
namespace EvolutionaryArchitecture.Fitnet.Contracts.Core.UnitTests.PrepareContract.BusinessRules;
using Common.Core.BusinessRules;
using Core.PrepareContract.BusinessRules;
public sealed class PreviousContractHasToBeSignedRuleTests
{
[Fact]
internal void Given_previous_contract_signed_Then_validation_should_pass() =>
// Arrange & Act & Assert
Should.NotThrow(() => BusinessRuleValidator.Validate(new PreviousContractHasToBeSignedRule(true)));
[Fact]
internal void Given_previous_contract_not_exists_Then_validation_should_pass() =>
// Arrange & Act & Assert
Should.NotThrow(() => BusinessRuleValidator.Validate(new PreviousContractHasToBeSignedRule(null)));
[Fact]
internal void Given_previous_contract_unsigned_Then_validation_should_throw()
{
// Arrange & Act & Assert
var exception = Should.Throw<BusinessRuleValidationException>(() =>
BusinessRuleValidator.Validate(new PreviousContractHasToBeSignedRule(false)));
exception.Message.ShouldBe("Previous contract must be signed by the customer");
}
}