public void NoMatch_ExpectNullReturned() { //Arrange var poems = new PoemBuilder().Default().BuildCollection(size: 3); //Act var spec = new GetPoemAndPublishedRevisionByIdSpec(Guid.Empty); var testResult = poems.AsQueryable().FirstOrDefault(spec.Criteria); //Assert Assert.Null(testResult); }
public void ExactMatch_ExpectPoemReturned() { //Arrange var poems = new PoemBuilder().Default().BuildCollection(size: 3).ToList(); var expectResult = poems[1]; //Act var spec = new GetPoemAndPublishedRevisionByIdSpec(expectResult.Id); var testResult = poems.AsQueryable().FirstOrDefault(spec.Criteria); //Assert Assert.NotNull(testResult); Assert.Equal(expectResult.Id, testResult.Id); }