public void CreateAndDeleteCommit() { string cpath = path + "\\Commits\\test.json"; Commit c = new Commit(new Commit[] { directory.GetCommit("init") }, directory.GetChangelog("initChild"), directory.GetVersion("initChild"), new CommitMetadata(""), "test"); directory.CreateCommit(c); Assert.IsTrue(File.Exists(cpath)); string text = File.ReadAllText(cpath); Assert.AreEqual(text, "{\r\n \"Hash\": \"test\",\r\n \"Parents\": [\r\n \"init\"\r\n ],\r\n \"Changelog\": \"initChild\",\r\n \"Version\": \"initChild\",\r\n \"Metadata\": {}\r\n}"); directory.DeleteCommit(c); Assert.IsFalse(File.Exists(cpath)); }
/// <summary> /// Saves a Commit to the file directory /// </summary> /// <param name="commit"></param> public void CreateCommit(Commit commit) { directory.CreateCommit(commit); }