This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DbSetMockHelper | |
{ | |
public static DbSet<TEntity> CreateMock<TEntity,TContext>(List<TEntity> entities, out TContext context) where TEntity : class where TContext: class | |
{ | |
IQueryable<TEntity> data = entities.AsQueryable(); | |
DbSet<TEntity> mockSet = A.Fake<DbSet<TEntity>>(d => d.Implements<IQueryable<TEntity>>().Implements<IAsyncEnumerable<TEntity>>()); | |
A.CallTo(() => ((IAsyncEnumerable<TEntity>)mockSet).GetEnumerator()) | |
.Returns(new TestAsyncEnumerator<TEntity>(data.GetEnumerator())); | |
A.CallTo(() => ((IQueryable<TEntity>)mockSet).Provider).Returns(new TestAsyncQueryProvider<TEntity>(data.Provider)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class AsyncQueryTests | |
{ | |
[Test] | |
public async Task GetAllBlogsAsync_orders_by_name() | |
{ | |
var data = new List<Blog> | |
{ | |
new Blog { Name = "BBB" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore.Query.Internal; | |
namespace Application | |
{ | |
internal class TestAsyncQueryProvider<TEntity> : IAsyncQueryProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/p:Configuration=Release | |
/p:OutputPath=bin | |
/p:DeployOnBuild=True | |
/p:DeployTarget=MSDeployPublish | |
/p:MsDeployServiceUrl=YOUR_PROJECT.scm.azure-mobile.net:443 | |
/p:username="%deployUser%" | |
/p:password=%deployPassword% | |
/p:AllowUntrustedCertificate=True | |
/p:DeployIisAppPath=YOUR_PROJECT_WEBSITE | |
/p:MSDeployPublishMethod=WMSVC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/p:Configuration=Release | |
/p:OutputPath=bin | |
/p:DeployOnBuild=True | |
/p:DeployTarget=MSDeployPublish | |
/p:MsDeployServiceUrl=YOUR_PROJECT.scm.azure-mobile.net:443 | |
/p:username="$USERNAME" | |
/p:password="A_VERY_LONG_PASSWORD" | |
/p:AllowUntrustedCertificate=True | |
/p:DeployIisAppPath=YOUR_PROJECT_WEBSITE | |
/p:MSDeployPublishMethod=WMSVC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/p:Configuration=Release | |
/p:OutputPath=bin | |
/p:DeployOnBuild=True | |
/p:DeployTarget=MSDeployPublish | |
/p:MsDeployServiceUrl=YOUR_PROJECT.scm.azure-mobile.net:443 | |
/p:username="$USERNAME" | |
/p:password=%A_VERY_LONG_PASSWORD% | |
/p:AllowUntrustedCertificate=True | |
/p:DeployIisAppPath=YOUR_PROJECT_WEBSITE | |
/p:MSDeployPublishMethod=WMSVC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Reflection; | |
using System.Runtime.InteropServices; | |
// General Information about an assembly is controlled through the following | |
// set of attributes. Change these attribute values to modify the information | |
// associated with an assembly. | |
using Greenshot.Plugin; | |
[assembly: AssemblyTitle("GreenshotDemoPlugin")] | |
[assembly: AssemblyDescription("")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<IDestination> Destinations() | |
{ | |
yield return new DemoDestination(this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Windows.Forms; | |
using Greenshot.IniFile; | |
using Greenshot.Plugin; | |
using GreenshotPlugin.Controls; | |
using GreenshotPlugin.Core; | |
namespace GreenshotDemoPlugin | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Greenshot.IniFile; | |
using Greenshot.Plugin; | |
namespace GreenshotDemoPlugin | |
{ | |
public class DemoPlugin: IGreenshotPlugin | |
{ | |
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DemoPlugin)); |
NewerOlder