From b1e49e32dec6c8fd22522ebdc755df70f1364888 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 2 Oct 2018 11:04:37 -0400 Subject: [PATCH] Add TestServerFactory --- .../TestServerFactory.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/Tgstation.Server.Host.Tests/TestServerFactory.cs diff --git a/tests/Tgstation.Server.Host.Tests/TestServerFactory.cs b/tests/Tgstation.Server.Host.Tests/TestServerFactory.cs new file mode 100644 index 0000000000..1334ae87c9 --- /dev/null +++ b/tests/Tgstation.Server.Host.Tests/TestServerFactory.cs @@ -0,0 +1,32 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +namespace Tgstation.Server.Host.Tests +{ + /// + /// Tests for + /// + [TestClass] + public sealed class TestServerFactory + { + [TestMethod] + public void TestWorksWithoutUpdatePath() + { + var factory = new ServerFactory(); + + Assert.ThrowsException(() => factory.CreateServer(null, null)); + factory.CreateServer(Array.Empty(), null); + } + + [TestMethod] + public void TestWorksWithUpdatePath() + { + var factory = new ServerFactory(); + const string Path = "/test"; + + Assert.ThrowsException(() => factory.CreateServer(null, null)); + Assert.ThrowsException(() => factory.CreateServer(null, Path)); + factory.CreateServer(Array.Empty(), Path); + } + } +}