Skip to content

Commit

Permalink
Updated documentation to reflect api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
karlssberg committed May 4, 2024
1 parent 292a15f commit 37f7b5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Motiv/Documentation/WhenFalse.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ property of the result.

## False assertion collection derived from model/result

### `WhenFalse(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<string>> factory)`
### `WhenFalseYield(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<string>> factory)`

```csharp
Spec.Build(new IsEvenProposition())
.WhenTrue("is even")
.WhenFalse((n, result) => result.Assertions)
.WhenFalseYield((n, result) => result.Assertions)
.Create();
```

Expand All @@ -107,12 +107,12 @@ When the proposition is not satisfied, the metadata returned by the factory func

## False metadata collection derived from model/result

### `WhenFalse(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<TMetadata>> factory)`
### `WhenFalseYield(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<TMetadata>> factory)`

```csharp
Spec.Build(new IsEvenProposition())
.WhenTrue(new MyMetadata("is even"))
.WhenFalse((n, result) => result.Assertions.Select(assertion => new MyMetadata($"{n} {assertion}")))
.WhenFalseYield((n, result) => result.Assertions.Select(assertion => new MyMetadata($"{n} {assertion}")))
.Create("is even");
```

Expand Down
8 changes: 4 additions & 4 deletions Motiv/Documentation/WhenTrue.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ result.

## False assertion collection derived from model/result

### `WhenTrue(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<string>> factory)`
### `WhenTrueYield(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<string>> factory)`

```csharp
Spec.Build(new IsEvenProposition())
.WhenTrue((n, result) => result.Assertions)
.WhenTrueYield((n, result) => result.Assertions)
.WhenFalse("is odd")
.Create("is even");
```
Expand All @@ -120,11 +120,11 @@ When the proposition is satisfied, the assertion result from the factory functio

## False metadata collection derived from model/result

### `WhenTrue(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<TMetadata>> factory)`
### `WhenTrueYield(Func<TModel, BooleanResultBase<TMetadata>, IEnumerable<TMetadata>> factory)`

```csharp
Spec.Build(new IsEvenProposition())
.WhenTrue((n, result) => result.Assertions.Select(assertion => new MyMetadata($"{n} {assertion}")))
.WhenTrueYield((n, result) => result.Assertions.Select(assertion => new MyMetadata($"{n} {assertion}")))
.WhenFalse(new MyMetadata("is odd"))
.Create("is even");
```
Expand Down

0 comments on commit 37f7b5d

Please sign in to comment.