mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-22 20:47:28 +01:00
Add TestServerFactory
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
|
||||
namespace Tgstation.Server.Host.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests for <see cref="ServerFactory"/>
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public sealed class TestServerFactory
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestWorksWithoutUpdatePath()
|
||||
{
|
||||
var factory = new ServerFactory();
|
||||
|
||||
Assert.ThrowsException<ArgumentNullException>(() => factory.CreateServer(null, null));
|
||||
factory.CreateServer(Array.Empty<string>(), null);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestWorksWithUpdatePath()
|
||||
{
|
||||
var factory = new ServerFactory();
|
||||
const string Path = "/test";
|
||||
|
||||
Assert.ThrowsException<ArgumentNullException>(() => factory.CreateServer(null, null));
|
||||
Assert.ThrowsException<ArgumentNullException>(() => factory.CreateServer(null, Path));
|
||||
factory.CreateServer(Array.Empty<string>(), Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user