Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanho committed Mar 14, 2019
1 parent 0c2da1c commit dba04b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Postal.Tests/EmailServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Hosting;

namespace Postal
{
Expand Down Expand Up @@ -104,10 +105,13 @@ public void Dependency_injection_default()
serviceCollection.AddOptions();
var viewEngine = new Mock<IRazorViewEngine>();
var tempDataProvider = new Mock<ITempDataProvider>();
var hostingEnvironment = new Mock<IHostingEnvironment>();
var logger = new Mock<ILogger<EmailService>>();
serviceCollection.AddSingleton(logger.Object);
serviceCollection.AddSingleton(viewEngine.Object);
serviceCollection.AddSingleton(tempDataProvider.Object);
serviceCollection.AddSingleton(hostingEnvironment.Object);

serviceCollection.AddPostal();

var services = serviceCollection.BuildServiceProvider();
Expand Down Expand Up @@ -137,10 +141,12 @@ public void Dependency_injection_smtpOtions1()
serviceCollection.AddOptions();
var viewEngine = new Mock<IRazorViewEngine>();
var tempDataProvider = new Mock<ITempDataProvider>();
var hostingEnvironment = new Mock<IHostingEnvironment>();
var logger = new Mock<ILogger<EmailService>>();
serviceCollection.AddSingleton(logger.Object);
serviceCollection.AddSingleton(viewEngine.Object);
serviceCollection.AddSingleton(tempDataProvider.Object);
serviceCollection.AddSingleton(hostingEnvironment.Object);

serviceCollection.Configure<EmailServiceOptions>(_configuration);
serviceCollection.AddPostal();
Expand Down Expand Up @@ -171,10 +177,12 @@ public void Dependency_injection_smtpOtions2()
serviceCollection.AddOptions();
var viewEngine = new Mock<IRazorViewEngine>();
var tempDataProvider = new Mock<ITempDataProvider>();
var hostingEnvironment = new Mock<IHostingEnvironment>();
var logger = new Mock<ILogger<EmailService>>();
serviceCollection.AddSingleton(logger.Object);
serviceCollection.AddSingleton(viewEngine.Object);
serviceCollection.AddSingleton(tempDataProvider.Object);
serviceCollection.AddSingleton(hostingEnvironment.Object);

serviceCollection.Configure<EmailServiceOptions>(o =>
{
Expand Down Expand Up @@ -208,10 +216,12 @@ public void Dependency_injection_smtpOtions3()
serviceCollection.AddOptions();
var viewEngine = new Mock<IRazorViewEngine>();
var tempDataProvider = new Mock<ITempDataProvider>();
var hostingEnvironment = new Mock<IHostingEnvironment>();
var logger = new Mock<ILogger<EmailService>>();
serviceCollection.AddSingleton(logger.Object);
serviceCollection.AddSingleton(viewEngine.Object);
serviceCollection.AddSingleton(tempDataProvider.Object);
serviceCollection.AddSingleton(hostingEnvironment.Object);

serviceCollection.Configure<EmailServiceOptions>(o =>
{
Expand Down

0 comments on commit dba04b5

Please sign in to comment.