Skip to content

Commit

Permalink
v7.0.2
Browse files Browse the repository at this point in the history
#77 BuildMock moved to MockQueryable.EntityFrameworkCore - Thanks @skarllot
  • Loading branch information
romantitov committed Aug 20, 2024
1 parent 44663dc commit 052842b
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
<PackageTags>Mock EntityFrameworkCore Queryable mock EF UnitTests EntityFrameworkCore</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
#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
</PackageReleaseNotes>
<Version>7.0.1</Version>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<Version>7.0.2</Version>
<AssemblyVersion>7.0.0.2</AssemblyVersion>
<FileVersion>7.0.0.2</FileVersion>
<Company></Company>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
<PackageTags>Mock EntityFrameworkCore Queryable mock EF UnitTests EntityFrameworkCore</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
#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
</PackageReleaseNotes>
<Version>7.0.1</Version>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<Version>7.0.2</Version>
<AssemblyVersion>7.0.0.2</AssemblyVersion>
<FileVersion>7.0.0.2</FileVersion>
<Company></Company>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;
using System.Linq;


namespace MockQueryable.EntityFrameworkCore
{
public static class MockQueryableExtensions
{
public static IQueryable<TEntity> BuildMock<TEntity>(this IEnumerable<TEntity> data) where TEntity : class
{
return new TestAsyncEnumerableEfCore<TEntity>(data);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ namespace MockQueryable.FakeItEasy
{
public static class FakeItEasyExtensions
{
public static IQueryable<TEntity> BuildMock<TEntity>(this IEnumerable<TEntity> data) where TEntity : class
{
return new TestAsyncEnumerableEfCore<TEntity>(data);
}

public static DbSet<TEntity> BuildMockDbSet<TEntity>(this IEnumerable<TEntity> data) where TEntity : class => data.BuildMock().BuildMockDbSet();

public static DbSet<TEntity> BuildMockDbSet<TEntity>(this IQueryable<TEntity> data) where TEntity : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
<PackageTags>Mock EntityFrameworkCore Queryable mock EF EFCore UnitTests FakeItEasy</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
#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
</PackageReleaseNotes>
<Version>7.0.1</Version>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<Version>7.0.2</Version>
<AssemblyVersion>7.0.0.2</AssemblyVersion>
<FileVersion>7.0.0.2</FileVersion>
<Company></Company>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
9 changes: 4 additions & 5 deletions src/MockQueryable/MockQueryable.Moq/MockQueryable.Moq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
<PackageTags>Mock EntityFrameworkCore Queryable mock EF EFCore UnitTests EntityFrameworkCore Moq</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
#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
</PackageReleaseNotes>
<Version>7.0.1</Version>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<Version>7.0.2</Version>
<AssemblyVersion>7.0.0.2</AssemblyVersion>
<FileVersion>7.0.0.2</FileVersion>
<Company></Company>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
6 changes: 1 addition & 5 deletions src/MockQueryable/MockQueryable.Moq/MoqExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ namespace MockQueryable.Moq
{
public static class MoqExtensions
{
public static IQueryable<TEntity> BuildMock<TEntity>(this IEnumerable<TEntity> data) where TEntity : class
{
return new TestAsyncEnumerableEfCore<TEntity>(data);
}


public static Mock<DbSet<TEntity>> BuildMockDbSet<TEntity>(this IEnumerable<TEntity> data) where TEntity : class => data.BuildMock().BuildMockDbSet();

public static Mock<DbSet<TEntity>> BuildMockDbSet<TEntity>(this IQueryable<TEntity> data) where TEntity : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
<PackageTags>Mock EntityFrameworkCore Queryable mock EF EFCore UnitTests EntityFrameworkCore NSubstitute</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
#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
</PackageReleaseNotes>
<Version>7.0.1</Version>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<Version>7.0.2</Version>
<AssemblyVersion>7.0.0.2</AssemblyVersion>
<FileVersion>7.0.0.2</FileVersion>
<Company></Company>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ namespace MockQueryable.NSubstitute
{
public static class NSubstituteExtensions
{
public static IQueryable<TEntity> BuildMock<TEntity>(this IEnumerable<TEntity> data) where TEntity : class
{
return new TestAsyncEnumerableEfCore<TEntity>(data);
}

public static DbSet<TEntity> BuildMockDbSet<TEntity>(this IEnumerable<TEntity> data) where TEntity : class => data.BuildMock().BuildMockDbSet();

public static DbSet<TEntity> BuildMockDbSet<TEntity>(this IQueryable<TEntity> data) where TEntity : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Tasks;
using FakeItEasy;
using Microsoft.EntityFrameworkCore;
using MockQueryable.EntityFrameworkCore;
using MockQueryable.FakeItEasy;
using NUnit.Framework;

Expand Down
6 changes: 2 additions & 4 deletions src/MockQueryable/MockQueryable.Sample/MyServiceMoqTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MockQueryable.NSubstitute;
using MockQueryable.EntityFrameworkCore;
using MockQueryable.NSubstitute;
using NSubstitute;
using NUnit.Framework;
using System;
Expand Down

0 comments on commit 052842b

Please sign in to comment.