public async Task Handle_NullRequest_ThrowsArgumentNull(FindAllEndpointsHandler subject) { // Arrange // Act Func <Task> act = () => subject.Handle(null, default); // Assert await act .Should() .ThrowExactlyAsync <ArgumentNullException>(); }
public async Task Handle_EmptyContext_ReturnsEmptyList(FindAllEndpointsHandler subject) { // Arrange // Act var result = await subject.Handle(new FindAllEndpoints(), default); // Assert result .Should() .NotBeNull().And .BeEmpty(); }
public async Task Handle_ExistingContext_ReturnsList([Frozen] LandisGyrContext context, IEnumerable <Endpoint> endpoints, FindAllEndpointsHandler subject) { // Arrange context.AddRange(endpoints); await context.SaveChangesAsync(); // Act var result = await subject.Handle(new FindAllEndpoints(), default); // Assert result .Should() .NotBeNull().And .HaveSameCount(context.Endpoints); }