public void Reset_WhenCameraIdDoesNotExist_ShouldThrowException() { // GIVEN var moduleDispatcher = new ModuleDispatcher(); var module = new CamerasModule(moduleDispatcher); var cameraFileName = _WriteCameraResourceToFile(); // WHEN-THEN Exception actualException = Assert.Catch(typeof(ArgumentException), delegate { CamResetDelegate(module, cameraFileName); }); Assert.AreEqual("Specified camera identifier does not exist: 0\nParameter name: entryId", actualException.Message); }
public void GetCamFileNameParam_WhenArgs_ShouldReturnFirstOne() { // GIVEN List <string> args = new List <string>(); args.Add("cameras.bin"); args.Add("1"); // WHEN string actualParam = CamerasModule.GetCamFileNameParam(args); // THEN Assert.AreEqual("cameras.bin", actualParam); }
public void GetCamIdParam_WhenArgs_ShouldReturnSecondOne() { // GIVEN List <string> args = new List <string>(); args.Add("cameras.bin"); args.Add("1"); // WHEN int actualParam = CamerasModule.GetCamIdParam(args); // THEN Assert.AreEqual(1, actualParam); }
public void List_WhenCameraIdExists_AndNewCameraIdentifier_ShouldReturnDetails() { // GIVEN var moduleDispatcher = new ModuleDispatcher(); var module = new CamerasModule(moduleDispatcher); var cameraFileName = _WriteCameraResourceToFile(); // WHEN module.List(new string[] { cameraFileName, "315" }); // THEN var expectedOutput = _ReadTextFromResourceFile("Djey.TduModdingTools.CLI.Resources.ListCameraOutput-Default.json"); Assert.AreEqual(expectedOutput, moduleDispatcher.ModuleOutput); }
private static void CamResetDelegate(CamerasModule module, string cameraFileName) { module.Reset(new string[] { cameraFileName, "000" }); }
private static void CamCustomizeDelegate(CamerasModule module, string cameraFileName, string customizeInputFileName) { module.Customize(new string[] { cameraFileName, "000", customizeInputFileName }); }