public void Start() { // reset state GameServer.Stop(); unityServer = Substitute.For <IUnityServer>(); unityServer.StartServer().Returns(false); Assert.Throws <Exception>(() => GameServer.Start(unityServer)); unityServer.Received(10).StartServer(); unityServer.ClearReceivedCalls(); unityServer.StartServer().Returns(true); GameServer.Start(unityServer); unityServer.Received(1).StartServer(); Assert.Throws <Exception>(() => GameServer.Start(unityServer)); }
public void Setup() { unityServer = Substitute.For <IUnityServer>(); unityServer.StartServer().Returns(true); GameServer.Start(unityServer); }