public void AddInvalid_NugetFile_Throws() { b.Info.Flow(); MockVersionStorage mvs = new MockVersionStorage("0.0.0.1"); Versioning sut = new Versioning(mvs); Assert.Throws <ArgumentNullException>(() => { sut.AddNugetFile(null); }); Assert.Throws <FileNotFoundException>(() => { sut.AddNugetFile(""); }); Assert.Throws <FileNotFoundException>(() => { sut.AddNugetFile("c:\\arflebarflegloop.txt"); }); }
private static Action <string> GetActionToPerform(Versioning ver) { Action <string> ActionToPerform; if (!options.TestMode) { ActionToPerform = (fn) => { if (fn.EndsWith(".cs")) { ver.AddCSharpFile(fn); } if (fn.EndsWith(".nuspec")) { ver.AddNugetFile(fn); } }; } else { Console.WriteLine("Dry Run Mode Active."); ActionToPerform = (fn) => { Console.WriteLine("Would Update :" + fn); }; } return(ActionToPerform); }
public void UC_UpdateNuspecFile_Works() { b.Info.Flow(); var reid = TestResources.GetIdentifiers(TestResourcesReferences.NuspecSample1); string srcFile = uth.GetTestDataFile(reid); MockVersionStorage mvs = new MockVersionStorage("0.0.0.1"); Versioning sut = new Versioning(mvs); sut.AddNugetFile(srcFile); }