diff --git a/src/MockQueryable/MockQueryable.Core/MockQueryable.Core.csproj b/src/MockQueryable/MockQueryable.Core/MockQueryable.Core.csproj index f596524..fc81a24 100644 --- a/src/MockQueryable/MockQueryable.Core/MockQueryable.Core.csproj +++ b/src/MockQueryable/MockQueryable.Core/MockQueryable.Core.csproj @@ -14,12 +14,11 @@ Mock EntityFrameworkCore Queryable mock EF UnitTests EntityFrameworkCore true - #74 Fix ToListAsync() for mocked DbSet by using lazy-creation of AsyncEnumerator - Thanks @fischero19 - #75 Added method for build DbSet from IEnumerable. - Thanks @sq735 + #77 BuildMock moved to MockQueryable.EntityFrameworkCore - Thanks @skarllot - 7.0.1 - 7.0.0.1 - 7.0.0.1 + 7.0.2 + 7.0.0.2 + 7.0.0.2 LICENSE README.md diff --git a/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryable.EntityFrameworkCore.csproj b/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryable.EntityFrameworkCore.csproj index 0ccaa29..0e8a981 100644 --- a/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryable.EntityFrameworkCore.csproj +++ b/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryable.EntityFrameworkCore.csproj @@ -15,12 +15,11 @@ Mock EntityFrameworkCore Queryable mock EF UnitTests EntityFrameworkCore true - #74 Fix ToListAsync() for mocked DbSet by using lazy-creation of AsyncEnumerator - Thanks @fischero19 - #75 Added method for build DbSet from IEnumerable. - Thanks @sq735 + #77 BuildMock moved to MockQueryable.EntityFrameworkCore - Thanks @skarllot - 7.0.1 - 7.0.0.1 - 7.0.0.1 + 7.0.2 + 7.0.0.2 + 7.0.0.2 LICENSE README.md diff --git a/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryableExtensions.cs b/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryableExtensions.cs new file mode 100644 index 0000000..950e587 --- /dev/null +++ b/src/MockQueryable/MockQueryable.EntityFrameworkCore/MockQueryableExtensions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Linq; + + +namespace MockQueryable.EntityFrameworkCore +{ + public static class MockQueryableExtensions + { + public static IQueryable BuildMock(this IEnumerable data) where TEntity : class + { + return new TestAsyncEnumerableEfCore(data); + } + } +} diff --git a/src/MockQueryable/MockQueryable.FakeItEasy/FakeItEasyExtensions.cs b/src/MockQueryable/MockQueryable.FakeItEasy/FakeItEasyExtensions.cs index 58c1724..ee8c1b0 100644 --- a/src/MockQueryable/MockQueryable.FakeItEasy/FakeItEasyExtensions.cs +++ b/src/MockQueryable/MockQueryable.FakeItEasy/FakeItEasyExtensions.cs @@ -10,11 +10,6 @@ namespace MockQueryable.FakeItEasy { public static class FakeItEasyExtensions { - public static IQueryable BuildMock(this IEnumerable data) where TEntity : class - { - return new TestAsyncEnumerableEfCore(data); - } - public static DbSet BuildMockDbSet(this IEnumerable data) where TEntity : class => data.BuildMock().BuildMockDbSet(); public static DbSet BuildMockDbSet(this IQueryable data) where TEntity : class diff --git a/src/MockQueryable/MockQueryable.FakeItEasy/MockQueryable.FakeItEasy.csproj b/src/MockQueryable/MockQueryable.FakeItEasy/MockQueryable.FakeItEasy.csproj index 4915c1f..fd82299 100644 --- a/src/MockQueryable/MockQueryable.FakeItEasy/MockQueryable.FakeItEasy.csproj +++ b/src/MockQueryable/MockQueryable.FakeItEasy/MockQueryable.FakeItEasy.csproj @@ -14,12 +14,11 @@ Mock EntityFrameworkCore Queryable mock EF EFCore UnitTests FakeItEasy true - #74 Fix ToListAsync() for mocked DbSet by using lazy-creation of AsyncEnumerator - Thanks @fischero19 - #75 Added method for build DbSet from IEnumerable. - Thanks @sq735 + #77 BuildMock moved to MockQueryable.EntityFrameworkCore - Thanks @skarllot - 7.0.1 - 7.0.0.1 - 7.0.0.1 + 7.0.2 + 7.0.0.2 + 7.0.0.2 LICENSE README.md diff --git a/src/MockQueryable/MockQueryable.Moq/MockQueryable.Moq.csproj b/src/MockQueryable/MockQueryable.Moq/MockQueryable.Moq.csproj index 5eec3a2..a9b5aea 100644 --- a/src/MockQueryable/MockQueryable.Moq/MockQueryable.Moq.csproj +++ b/src/MockQueryable/MockQueryable.Moq/MockQueryable.Moq.csproj @@ -14,12 +14,11 @@ Mock EntityFrameworkCore Queryable mock EF EFCore UnitTests EntityFrameworkCore Moq true - #74 Fix ToListAsync() for mocked DbSet by using lazy-creation of AsyncEnumerator - Thanks @fischero19 - #75 Added method for build DbSet from IEnumerable. - Thanks @sq735 + #77 BuildMock moved to MockQueryable.EntityFrameworkCore - Thanks @skarllot - 7.0.1 - 7.0.0.1 - 7.0.0.1 + 7.0.2 + 7.0.0.2 + 7.0.0.2 LICENSE README.md diff --git a/src/MockQueryable/MockQueryable.Moq/MoqExtensions.cs b/src/MockQueryable/MockQueryable.Moq/MoqExtensions.cs index 468b90b..dafd6b0 100644 --- a/src/MockQueryable/MockQueryable.Moq/MoqExtensions.cs +++ b/src/MockQueryable/MockQueryable.Moq/MoqExtensions.cs @@ -10,11 +10,7 @@ namespace MockQueryable.Moq { public static class MoqExtensions { - public static IQueryable BuildMock(this IEnumerable data) where TEntity : class - { - return new TestAsyncEnumerableEfCore(data); - } - + public static Mock> BuildMockDbSet(this IEnumerable data) where TEntity : class => data.BuildMock().BuildMockDbSet(); public static Mock> BuildMockDbSet(this IQueryable data) where TEntity : class diff --git a/src/MockQueryable/MockQueryable.NSubstitute/MockQueryable.NSubstitute.csproj b/src/MockQueryable/MockQueryable.NSubstitute/MockQueryable.NSubstitute.csproj index 5a14860..461e2a0 100644 --- a/src/MockQueryable/MockQueryable.NSubstitute/MockQueryable.NSubstitute.csproj +++ b/src/MockQueryable/MockQueryable.NSubstitute/MockQueryable.NSubstitute.csproj @@ -14,12 +14,11 @@ Mock EntityFrameworkCore Queryable mock EF EFCore UnitTests EntityFrameworkCore NSubstitute true - #74 Fix ToListAsync() for mocked DbSet by using lazy-creation of AsyncEnumerator - Thanks @fischero19 - #75 Added method for build DbSet from IEnumerable. - Thanks @sq735 + #77 BuildMock moved to MockQueryable.EntityFrameworkCore - Thanks @skarllot - 7.0.1 - 7.0.0.1 - 7.0.0.1 + 7.0.2 + 7.0.0.2 + 7.0.0.2 LICENSE README.md diff --git a/src/MockQueryable/MockQueryable.NSubstitute/NSubstituteExtensions.cs b/src/MockQueryable/MockQueryable.NSubstitute/NSubstituteExtensions.cs index 0068608..0db0998 100644 --- a/src/MockQueryable/MockQueryable.NSubstitute/NSubstituteExtensions.cs +++ b/src/MockQueryable/MockQueryable.NSubstitute/NSubstituteExtensions.cs @@ -10,11 +10,6 @@ namespace MockQueryable.NSubstitute { public static class NSubstituteExtensions { - public static IQueryable BuildMock(this IEnumerable data) where TEntity : class - { - return new TestAsyncEnumerableEfCore(data); - } - public static DbSet BuildMockDbSet(this IEnumerable data) where TEntity : class => data.BuildMock().BuildMockDbSet(); public static DbSet BuildMockDbSet(this IQueryable data) where TEntity : class diff --git a/src/MockQueryable/MockQueryable.Sample/MyServiceFakeItEasyTests.cs b/src/MockQueryable/MockQueryable.Sample/MyServiceFakeItEasyTests.cs index e74d2ee..5fcd0c8 100644 --- a/src/MockQueryable/MockQueryable.Sample/MyServiceFakeItEasyTests.cs +++ b/src/MockQueryable/MockQueryable.Sample/MyServiceFakeItEasyTests.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using FakeItEasy; using Microsoft.EntityFrameworkCore; +using MockQueryable.EntityFrameworkCore; using MockQueryable.FakeItEasy; using NUnit.Framework; diff --git a/src/MockQueryable/MockQueryable.Sample/MyServiceMoqTests.cs b/src/MockQueryable/MockQueryable.Sample/MyServiceMoqTests.cs index dbf8e9b..79ac0fc 100644 --- a/src/MockQueryable/MockQueryable.Sample/MyServiceMoqTests.cs +++ b/src/MockQueryable/MockQueryable.Sample/MyServiceMoqTests.cs @@ -5,16 +5,14 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; -using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; -using Microsoft.EntityFrameworkCore.Metadata; +using MockQueryable.EntityFrameworkCore; using MockQueryable.Moq; using Moq; using NUnit.Framework; namespace MockQueryable.Sample { - [TestFixture] + [TestFixture] public class MyServiceMoqTests { private static readonly CultureInfo UsCultureInfo = new CultureInfo("en-US"); diff --git a/src/MockQueryable/MockQueryable.Sample/MyServiceNSubstituteTests.cs b/src/MockQueryable/MockQueryable.Sample/MyServiceNSubstituteTests.cs index 1f9e08c..3131323 100644 --- a/src/MockQueryable/MockQueryable.Sample/MyServiceNSubstituteTests.cs +++ b/src/MockQueryable/MockQueryable.Sample/MyServiceNSubstituteTests.cs @@ -1,4 +1,5 @@ -using MockQueryable.NSubstitute; +using MockQueryable.EntityFrameworkCore; +using MockQueryable.NSubstitute; using NSubstitute; using NUnit.Framework; using System;