示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 private static void CamResetDelegate(CamerasModule module, string cameraFileName)
 {
     module.Reset(new string[] { cameraFileName, "000" });
 }
示例#6
0
 private static void CamCustomizeDelegate(CamerasModule module, string cameraFileName, string customizeInputFileName)
 {
     module.Customize(new string[] { cameraFileName, "000", customizeInputFileName });
 }