Exemplo n.º 1
0
        public void EditProjectAndSave()
        {
            var uiSvc = new FakeShellUiService();
            var epi   = new EditProjectInteractor();
            var p     = CreateTestProject();

            var ret = epi.EditProjectProperties(uiSvc, p, delegate(Project_v3 project)
            {
                var input = (DecompilerInput_v3)project.Inputs[0];
                Assert.AreEqual("test.exe", input.Filename);
                Assert.AreEqual("test.asm", input.DisassemblyFilename);
                Assert.AreEqual("test.dis", input.IntermediateFilename);
                Assert.AreEqual("test.h", input.TypesFilename);
                Assert.AreEqual("test.c", input.OutputFilename);
            });

            Assert.IsTrue(ret);
        }
Exemplo n.º 2
0
        public void EditProjectAndCancel()
        {
            FakeShellUiService uiSvc = new FakeShellUiService();

            uiSvc.SimulateUserCancel = true;
            var project = CreateTestProject();
            var epi     = new EditProjectInteractor();
            var ret     = epi.EditProjectProperties(uiSvc, project, delegate(Project_v1 p)
            {
                Assert.Fail("Should not save if user cancels.");
            });

            Assert.IsFalse(ret);
            Assert.AreEqual("test.exe", project.Input.Filename);
            Assert.AreEqual("10000", project.Input.Address);
            Assert.AreEqual("test.asm", project.Output.DisassemblyFilename);
            Assert.AreEqual("test.dis", project.Output.IntermediateFilename);
            Assert.AreEqual("test.h", project.Output.TypesFilename);
            Assert.AreEqual("test.c", project.Output.OutputFilename);
        }