public void Delete_CallsContextDelete_WhenCalled(
            [NotNull, Frozen] IPersonsContext context,
            [NotNull] PersonsRepository sut)
        {
            // Arrange
            // Act
            sut.Delete(-1);

            // Assert
            context.Received().Delete(-1);
        }
        public void All_CallsContextPersons_WhenCalled(
            [NotNull, Frozen] IPersonsContext context,
            [NotNull] PersonsRepository sut)
        {
            // Arrange
            // Act
            // ReSharper disable once UnusedVariable
            IQueryable <IPerson> actual = sut.All;

            // Assert
            context.Received().Persons();
        }
        public void All_ReturnsPersons_WhenCalled(
            [NotNull, Frozen] IPersonsContext context,
            [NotNull] PersonsRepository sut)
        {
            // Arrange
            context.Persons().Returns(CreatePersons);

            // Act
            // ReSharper disable once UnusedVariable
            IQueryable <IPerson> actual = sut.All;

            // Assert
            Assert.Equal(2,
                         actual.Count());
        }
        public void Delete_ReturnsPerson_WhenCalled(
            [NotNull] IPerson person,
            [NotNull, Frozen] IPersonsContext context,
            [NotNull] PersonsRepository sut)
        {
            // Arrange
            context.Delete(Arg.Any <int>()).Returns(person);

            // Act
            IPerson actual = sut.Delete(-1);

            // Assert
            Assert.Equal(person,
                         actual);
        }