Exemple #1
0
        public void TestExpandCfgValue()
        {
            var testResult = NfConfig.ExpandCfgValue(testInput, @"$(tempRootDir)\httpAppDomain");

            Assert.IsNotNull(testInput);
            Console.WriteLine(testResult);
        }
Exemple #2
0
 public void TestResolveIdValueHash()
 {
     NfConfig.ResolveIdValueHash(testInput);
     Assert.IsNotNull(testInput);
     Assert.AreNotEqual(0, testInput.Count);
     foreach (var k in testInput.Keys)
     {
         Console.WriteLine($"{k} = {testInput[k]}");
     }
 }
Exemple #3
0
        public void TestGetIdValueHash()
        {
            var cfgXml = new XmlDocument();

            cfgXml.LoadXml(TEST_FILE);
            var idValueHash = NfConfig.GetIdValueHash(cfgXml);

            Assert.IsNotNull(idValueHash);
            Assert.AreNotEqual(0, idValueHash.Count);
            foreach (var k in idValueHash.Keys)
            {
                Console.WriteLine("{" + $"\"{k}\", @\"{idValueHash[k]}\"" + "},");
            }
        }
Exemple #4
0
        public void TestInit()
        {
            NfConfig.Init(TEST_FILE);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin", NfConfig.BinDirectories.Root);
            var puncChars = @"! # $ % & \ ' ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~";

            Assert.AreEqual(puncChars, string.Join(" ", NfSettings.PunctuationChars));

            Assert.AreEqual(@"C:\Projects\_NoFuture\temp", NfConfig.TempDirectories.Root);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\sql", NfConfig.TempDirectories.Sql);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\prox", NfConfig.TempDirectories.StoredProx);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code", NfConfig.TempDirectories.Code);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\debug", NfConfig.TempDirectories.Debug);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\graph", NfConfig.TempDirectories.Graph);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\svcUtil", NfConfig.TempDirectories.SvcUtil);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\wsdl", NfConfig.TempDirectories.Wsdl);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\hbm", NfConfig.TempDirectories.Hbm);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\java\src", NfConfig.TempDirectories.JavaSrc);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\java\build", NfConfig.TempDirectories.JavaBuild);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\java\dist", NfConfig.TempDirectories.JavaDist);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\code\java\archive", NfConfig.TempDirectories.JavaArchive);
            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\audio", NfConfig.TempDirectories.Audio);

            Assert.AreEqual(@"C:\Projects\_NoFuture\temp\netstat.txt", NfConfig.TempFiles.NetStat);

            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\amd64", NfConfig.BinDirectories.X64Root);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\x86", NfConfig.BinDirectories.X86Root);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\java", NfConfig.BinDirectories.JavaRoot);

            Assert.AreEqual(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\svcUtil.exe", NfConfig.X64.SvcUtil);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\amd64\vs10\dumpbin.exe", NfConfig.X64.Dumpbin);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\amd64\sqlcmd\SQLCMD.EXE", NfConfig.X64.SqlCmd);
            Assert.AreEqual(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\wsdl.exe", NfConfig.X64.Wsdl);
            Assert.AreEqual(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\xsd.exe", NfConfig.X64.XsdExe);

            Assert.AreEqual(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\sqlmetal.exe", NfConfig.X86.SqlMetal);
            Assert.AreEqual(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\svcUtil.exe", NfConfig.X86.SvcUtil);
            Assert.AreEqual(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\wsdl.exe", NfConfig.X86.Wsdl);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\graphviz-2.38\bin\dot.exe", NfConfig.X86.DotExe);

            Assert.AreEqual(799, NfConfig.NfDefaultPorts.NsLookupPort);

            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\java\bin\javac.exe", NfConfig.JavaTools.Javac);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\java\bin\java.exe", NfConfig.JavaTools.Java);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\java\bin\jar.exe", NfConfig.JavaTools.Jar);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\antlr-4.7.1-complete.jar", NfConfig.JavaTools.Antlr);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\stanford-postagger-2017-06-09\stanford-postagger.jar", NfConfig.JavaTools.StanfordPostTagger);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\stanford-postagger-2017-06-09\models\", NfConfig.JavaTools.StanfordPostTaggerModels);

            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\Dia2Dump.exe", NfConfig.CustomTools.Dia2Dump);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Gen.InvokeGetCgOfType.exe", NfConfig.CustomTools.InvokeGetCgType);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Gen.InvokeGraphViz.exe", NfConfig.CustomTools.InvokeGraphViz);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Tokens.DotNetMeta.InvokeAssemblyAnalysis.exe", NfConfig.CustomTools.InvokeAssemblyAnalysis);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Tokens.Gia.InvokeFlatten.exe", NfConfig.CustomTools.InvokeFlatten);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Tokens.Pos.Host\NoFuture.Tokens.Pos.Host.exe", NfConfig.CustomTools.TokensPosHost);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Tokens.DotNetMeta.InvokeDpx.exe", NfConfig.CustomTools.InvokeDpx);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\NoFuture.Tokens.InvokeNfTypeName.exe", NfConfig.CustomTools.InvokeNfTypeName);

            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\ffmpeg.exe", NfConfig.PythonTools.Ffmpeg);
            Assert.AreEqual(@"C:\Projects\_NoFuture\bin\youtube-dl.exe", NfConfig.PythonTools.YoutubeDl);

            Assert.IsTrue(NfConfig.Switches.SqlFiltersOff);
            Assert.IsTrue(NfConfig.Switches.PrintWebHeaders);

            Assert.AreEqual(@"C:\Projects\_NoFuture\NoFuture.cer", NfConfig.SecurityKeys.NoFutureX509Cert);

            var codeFiles =
                "ada adb adml admx ads as asa asax ascx asm asmx asp aspx bas bat bsh c cbd cbl cc cdb cdc cls cmd cob cpp cs cshtml css cu cuh cxx dsr dtd f f2k f90 f95 fbs for frm fs fsx fxh g4 gv h hpp hs hta htm html hxx idl inc java js jsx json kml las lhs lisp lsp lua m master ml mli mx nt pas php php3 phtml pl plx pm ps ps1 psm1 py pyw r rb rbw rpx sbt scala scm scp scss sep sh shtm shtml smd sml sql ss st tcl tex thy tt ts vb vbhtml vbs vrg wsc wsdl wsf xaml xhtml xlf xliff xsd xsl xslt xsml xst xsx";
            var cfgFiles =
                "acl aml cfg cmake conf config content csproj cva database dgml din dsw dtproj dtsx dun ecf editorconfig edmx fcc fsproj gpd h1k hkf inf ini isp iss manifest md npmrc nuspec obe overrideTasks pdm pp props ps1xml psc1 psd1 rej rsp sam sch sitemap sln sps stp svc targets tasks testsettings theme user vbp vbproj vdproj vsmdi xbap xml xrm-ms xss yarnrc yml";
            var binFiles =
                "001 002 003 004 005 006 007 008 009 010 7z aas acm addin adm am amx ani apk apl aps aux avi ax bak bcf bcm bin bmp bpd bpl browser bsc btr bud cab cache camp cap cat cch ccu cdf-ms cdmp chk chm chr chs cht clb cmb cmdline cmf com comments compiled compositefont cov cpa cpl cpx crmlog crt csd ctm cty cur cw dat data db dcf dcr default delete dem desklink devicemetadata-ms diagpkg dic dir dll dlm dls dmp dnl doc docx drv ds dts dub dvd dvr-ms dxt ebd edb efi emf eot err ess etl ev1 ev2 ev3 evm evtx ex_ exe exp fb fe fon ftl fx gdl gif gmmp grl grm gs_4_0 h1c h1s h1t hdr hex hit hlp hpi hpx iad icc icm ico id idb idx iec if2 ilk imd ime inf_loc ins inx ipa ird jar jmx jnt job jpeg jpg jpn jrs jtp kor ldo lex lg1 lg2 lib library-ms lng lnk log lrc lts lxa mac man map mapimail mdb mdbx mfl mib mid mllr mni mof mp3 mp4 mpg msc msi msm msstyles mst msu mui mum mzz ncb ndx ngr nlp nls nlt ntf nupkg obj ocx olb old opt otf out pch pdb pdf phn pkc plugin pnf png ppd pptx prm prof propdesc prq prx ps_2_0 ps_4_0 psd ptxml pub que rat rdl reg res resources resx rld rll rom rpo rs rtf s3 sbr scc scr sdb sdi ses shp smp sqm ssm stl swf sys t4 tag tar.gz tbl tbr tha tif tiff tlb tmp toc tpi trie1 tsp ttc ttf tts tx_ txt uaq uce udt uni uninstall unt url vch vdf ver vp vs_1_1 vs_4_0 vsd vspscc wav wdf web wih wim win32manifest wma wmf wmv wmz woff woff2 wtv wwd x32 xex xlb xls xlsx zfsendtotarget zip";

            Assert.AreEqual(codeFiles, string.Join(" ", NfSettings.CodeFileExtensions));
            Assert.AreEqual(cfgFiles, string.Join(" ", NfSettings.ConfigFileExtensions));
            Assert.AreEqual(binFiles, string.Join(" ", NfSettings.BinaryFileExtensions));

            var exDirs =
                "\\bin\\ \\obj\\ \\Interop\\ \\TestResults\\ \\_svn\\ \\.svn\\ \\_ReSharper \\_TeamCity \\.git\\ \\.github\\ \\.nuget\\ \\.vs\\ \\lib\\ \\build\\ \\dist\\ \\packages\\ \\__pycache__\\ \\.metadata\\ \\.vscode\\";

            Assert.AreEqual(exDirs, string.Join(" ", NfSettings.ExcludeCodeDirectories));
        }