Skip to content

Commit

Permalink
Merge pull request #25 from IowaComputerGurus/feature/updates
Browse files Browse the repository at this point in the history
Fixed Web Dependency
  • Loading branch information
mitchelsellers committed Jun 26, 2023
2 parents df050e4 + 46428c3 commit 410594b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/NetCore.Utilities.Email.Tests/EmailContentFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.IO;
using ICG.NetCore.Utilities.Email;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Moq;
using Xunit;
Expand All @@ -13,13 +13,13 @@ public class EmailContentFactoryTests
{
private const string RelativePathToDefault = "..\\..\\..\\Templates\\Default.html";
private const string RelativePathToSpecial = "..\\..\\..\\Templates\\Special.html";
private Mock<IHostingEnvironment> _hostingEnvironmentMock;
private Mock<IOptions<EmailTemplateSettings>> _emailTemplateSettingsMock;
private static Mock<IHostEnvironment> _hostingEnvironmentMock;
private static Mock<IOptions<EmailTemplateSettings>> _emailTemplateSettingsMock;
private readonly IEmailTemplateFactory _factory;

public EmailContentFactoryTests()
{
_hostingEnvironmentMock = new Mock<IHostingEnvironment>();
_hostingEnvironmentMock = new Mock<IHostEnvironment>();
_hostingEnvironmentMock.Setup(h => h.ContentRootPath).Returns("..\\..\\..\\"); //Provides a path back to the root of the test project
_emailTemplateSettingsMock = new Mock<IOptions<EmailTemplateSettings>>();
_emailTemplateSettingsMock.Setup(s => s.Value).Returns(new EmailTemplateSettings
Expand Down
4 changes: 2 additions & 2 deletions src/NetCore.Utilities.Email.Tests/StartupExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
using ICG.NetCore.Utilities.Email;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -63,7 +63,7 @@ public void ServiceCollection_ShouldHaveRegisteredInstanceOfEmailFactory()
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
collection.AddSingleton<IHostingEnvironment>(new Mock<IHostingEnvironment>().Object);
collection.AddSingleton<IHostEnvironment>(new Mock<IHostEnvironment>().Object);
collection.UseIcgNetCoreUtilitiesEmail(configuration);
var services = collection.BuildServiceProvider();

Expand Down
6 changes: 3 additions & 3 deletions src/NetCore.Utilities.Email/EmailTemplateFactory.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.IO;
using System.Text;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;

namespace ICG.NetCore.Utilities.Email
Expand Down Expand Up @@ -31,11 +31,11 @@ public interface IEmailTemplateFactory

public class EmailTemplateFactory : IEmailTemplateFactory

Check warning on line 32 in src/NetCore.Utilities.Email/EmailTemplateFactory.cs

View workflow job for this annotation

GitHub Actions / Validate Build

Missing XML comment for publicly visible type or member 'EmailTemplateFactory'

Check warning on line 32 in src/NetCore.Utilities.Email/EmailTemplateFactory.cs

View workflow job for this annotation

GitHub Actions / Build & Publish to NuGet

Missing XML comment for publicly visible type or member 'EmailTemplateFactory'
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IHostEnvironment _hostingEnvironment;
private readonly IOptions<EmailTemplateSettings> _templateSettings;

public EmailTemplateFactory(IOptions<EmailTemplateSettings> templateSettings,

Check warning on line 37 in src/NetCore.Utilities.Email/EmailTemplateFactory.cs

View workflow job for this annotation

GitHub Actions / Validate Build

Missing XML comment for publicly visible type or member 'EmailTemplateFactory.EmailTemplateFactory(IOptions<EmailTemplateSettings>, IHostEnvironment)'

Check warning on line 37 in src/NetCore.Utilities.Email/EmailTemplateFactory.cs

View workflow job for this annotation

GitHub Actions / Build & Publish to NuGet

Missing XML comment for publicly visible type or member 'EmailTemplateFactory.EmailTemplateFactory(IOptions<EmailTemplateSettings>, IHostEnvironment)'
IHostingEnvironment hostingEnvironment)
IHostEnvironment hostingEnvironment)
{
_templateSettings = templateSettings;
_hostingEnvironment = hostingEnvironment;
Expand Down
5 changes: 3 additions & 2 deletions src/NetCore.Utilities.Email/NetCore.Utilities.Email.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 410594b

Please sign in to comment.