/ProgramTests.cs Secret
Created
September 5, 2017 13:09
Make Your Azure WebJobs Testable Again
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
[TestClass] | |
public class ProgramTests | |
{ | |
[TestMethod] | |
public void Given_JobHostBuilder_Main_ShouldReturn_Result() | |
{ | |
var builder = new Mock<IJobHostBuilder>(); | |
builder.SetupProperty(p => p.IsRunning); | |
// Inject a mocked instance to the property. | |
Program.WebJobHost = builder.Object; | |
Program.Main(); | |
builder.Object.IsRunning.Should().BeTrue(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment