mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 07:04:57 +01:00
As many tests as we can without the rewrite
This commit is contained in:
@@ -7,7 +7,7 @@ namespace TGServerService
|
||||
/// <summary>
|
||||
/// Configuration settings for a <see cref="ServerInstance"/>
|
||||
/// </summary>
|
||||
interface IInstanceConfig
|
||||
public interface IInstanceConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ServerInstance"/> directory this <see cref="IInstanceConfig"/> is for
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
using TGServiceTests;
|
||||
|
||||
namespace TGServerService.Tests
|
||||
@@ -17,5 +18,33 @@ namespace TGServerService.Tests
|
||||
{
|
||||
new ServerInstance(new InstanceConfig(TempPath), 1).Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the return value of <see cref="ServerInstance.PushTestmergeCommits"/>
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void TestPushTestMergeCommits()
|
||||
{
|
||||
var ic = new InstanceConfig(TempPath) { PushTestmergeCommits = false };
|
||||
using (var si = new ServerInstance(ic, 1))
|
||||
{
|
||||
Assert.IsFalse(si.PushTestmergeCommits());
|
||||
ic.PushTestmergeCommits = true;
|
||||
Assert.IsTrue(si.PushTestmergeCommits());
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestSetPushTestMergeCommits()
|
||||
{
|
||||
var ic = new InstanceConfig(TempPath) { PushTestmergeCommits = false };
|
||||
using (var si = new ServerInstance(ic, 1))
|
||||
{
|
||||
si.SetPushTestmergeCommits(true);
|
||||
Assert.IsTrue(ic.PushTestmergeCommits);
|
||||
si.SetPushTestmergeCommits(false);
|
||||
Assert.IsFalse(ic.PushTestmergeCommits);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user