Skip to content

Commit

Permalink
Add Sort_With_NoElements_Should_Return_EmptyArrayErrorMessage asserti…
Browse files Browse the repository at this point in the history
…on for SelectionSortService
  • Loading branch information
melikpehlivanov committed Mar 29, 2020
1 parent 97da562 commit 235843c
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,19 @@ public void Sort_With_AlreadySortedData_Should_Return_DataAlreadySortedErrorMess
.And
.Match(x => x.As<Result>().ErrorMessage == NotificationMessages.SortingAlgorithms.DataAlreadySortedErrorMessage);
}

[Fact]
public void Sort_With_NoElements_Should_Return_EmptyArrayErrorMessage()
{
// Act
var result = this.selectionSortService.Sort(Array.Empty<int>());

// Assert
result
.Should()
.Match(x => x.As<Result>().ErrorMessage != null)
.And
.Match(x => x.As<Result>().ErrorMessage == NotificationMessages.SortingAlgorithms.EmptyArrayErrorMessage);
}
}
}

0 comments on commit 235843c

Please sign in to comment.