Created
June 24, 2017 06:51
-
-
Save siennathesane/79d90d8af236c855ab3b4c777b167b44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using NUnit.Framework; | |
| using System; | |
| namespace Automata.Tests | |
| { | |
| [TestFixture] | |
| class WorkSpaceTest | |
| { | |
| private WorkSpace ws; | |
| private Config cfg; | |
| [OneTimeSetUp] | |
| public void Init() | |
| { | |
| ws = new WorkSpace("testKey", "C:\\tmp", "C:\tmp\\manifest.json"); | |
| cfg = new Config("Mike Lloyd", "[email protected]"); | |
| ws.Config = cfg; | |
| } | |
| [Test] | |
| public void NewWorkSpaceTest() | |
| { | |
| ws = new WorkSpace("testKey", "C:\\tmp", "C:\tmp\\manifest.json"); | |
| Assert.AreEqual(ws.key, "testKey"); | |
| Assert.AreEqual(ws.internalsPath, "C:\\tmp"); | |
| Assert.AreEqual(ws.ManifestURL, "C:\tmp\\manifest.json"); | |
| } | |
| [Test] | |
| public void NewUserTest() | |
| { | |
| Assert.AreEqual(cfg.User, "Mike Lloyd"); | |
| Assert.AreEqual(cfg.Email, "[email protected]"); | |
| Assert.That(cfg.UserHome, Is.Not.Empty); | |
| Console.WriteLine("User home dir is at {0}", cfg.UserHome); | |
| } | |
| [Test] | |
| public void GetUserConfigTest() | |
| { | |
| Config user = ws.GetConfig(); | |
| Assert.AreSame(user, cfg); | |
| } | |
| [Test] | |
| public void SaveConfigs() | |
| { | |
| bool good = ws.Save(); | |
| Assert.That(good, Is.True); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment