Skip to content

Instantly share code, notes, and snippets.

View hoetz's full-sized avatar

Florian Hötzinger hoetz

View GitHub Profile
[Fact]
public void Index_OneGet_ReturnsViewModel()
{
var sut= new HomeController();
var httpContext = new Mock<HttpContext>().Object;
var actionContext=new ActionContext(httpContext, new RouteData(), new ActionDescriptor());
sut.ActionContext=actionContext;
ViewResult result= sut.Index() as ViewResult;
Assert.True(result.ViewData.Model is StartPageViewModel);
@hoetz
hoetz / gist:2de70b06b55747570887
Created May 25, 2014 13:26
KRuntime build.sh error
Building Microsoft.Framework.ApplicationHost .NETFramework,Version=v4.5
System.TypeLoadException: Could not load type 'System.Reflection.Internal.MemoryMappedFileBlock' from assembly 'System.Reflection.Metadata, Version=1.0.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
...
.
..
at Microsoft.Framework.Project.BuildManager.Build () [0x00000] in <filename unknown>:0
@hoetz
hoetz / nodeazurecheat
Last active August 29, 2015 13:56
node.js express azure web site cheat sheet
-[install node.js azure sdk mac os x]
-azure account download
-[save pub file to disk]
-azure account import xxx.publishsettings
-azure site create sitename --git
-sudo npm install express -g
-express
-npm install
-[rename app.js to server.js]
-[node server.js] will start your app locally
@hoetz
hoetz / gist:5568826
Created May 13, 2013 14:45
Scriptcs + StreamO = Exchange notifications done easy
scriptcs -install StreamO
scriptcs
> using StreamO;
> using Microsoft.Exchange.WebServices.Data;
> var cred = new WebCredentials("[email protected]","password");
> var listener=new StreamingListener(cred,(eventData)=>{ Console.WriteLine("Event incoming for "+eventData.Sender.ToString()); });
> listener.AddSubscription("[email protected]");