Commit b71b8f2d authored by HankG's avatar HankG

Move factories from desktop app to library

parent 33698c71
......@@ -4,6 +4,7 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="Factory" />
<Folder Include="Models\" />
<Compile Update="**\*.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
......
using System.Diagnostics.CodeAnalysis;
using MySocialPortalLib.Service.SocialMediaConnectors;
namespace MySocialPortalDesktop.Factory
{
[SuppressMessage("ReSharper", "CA1822")]
public class SocialMediaConnectorFactory
{
......
using MySocialPortalDesktop.Factory;
using Xunit;
namespace MySocialPortalLibTest.Factory
{
public class RepositoryFactoryTest
{
[Fact]
public void TestInstances()
{
var instance1 = RepositoryFactory.Instance;
var instance2 = RepositoryFactory.Instance;
Assert.NotNull(instance1);
Assert.Equal(instance1, instance2);
}
[Fact]
public void TestAllPostsRepository()
{
Assert.NotNull(RepositoryFactory.Instance.AllPostsRepository);
}
[Fact]
public void TestLinkPreviewRepository()
{
Assert.NotNull(RepositoryFactory.Instance.LinkPreviewRepository);
}
[Fact]
public void TestMainPeopleRepository()
{
Assert.NotNull(RepositoryFactory.Instance.MainPeopleRepository);
}
}
}
\ No newline at end of file
using MySocialPortalDesktop.Factory;
using Xunit;
namespace MySocialPortalLibTest.Factory
{
public class SocialMediaConnectorFactoryTest
{
[Fact]
public void TestConstruction()
{
Assert.NotNull(new SocialMediaConnectorFactory());
}
[Fact]
public void TestTwitterConnector()
{
Assert.NotNull(new SocialMediaConnectorFactory().GetNewTwitterConnector());
}
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment