예제 #1
0
            public async Task Handle_EndpointNotFound_ReturnsNull([Frozen] LandisGyrContext context,
                                                                  Endpoint endpoint,
                                                                  FindEndpointHandler subject)
            {
                // Arrange
                context.Add(endpoint);
                await context.SaveChangesAsync();

                // Act
                var result = await subject.Handle(new FindEndpoint { SerialNumber = string.Empty }, default);

                // Assert
                result
                .Should()
                .BeNull();
            }
예제 #2
0
            public async Task Handle_ExistingContext_ReturnsEndpoint([Frozen] LandisGyrContext context,
                                                                     Endpoint endpoint,
                                                                     FindEndpointHandler subject)
            {
                // Arrange
                context.Add(endpoint);
                await context.SaveChangesAsync();

                // Act
                var result = await subject.Handle(new FindEndpoint { SerialNumber = endpoint.SerialNumber }, default);

                // Assert
                result
                .Should()
                .NotBeNull().And
                .BeEquivalentTo(endpoint);
            }