public void CsprojCorrector_GetLangVersion(CsprojConfigState configState)
        {
            CsprojCorrector csprojCorrector = new CsprojCorrector(this.PathToCsprojFile)
            {
                ConfigState = configState
            };

            var actualLangVersion = csprojCorrector.GetLangVersion();

            Assert.Equal(expected: _stateLangVersionBinding[configState], actual: actualLangVersion);
        }
        public void CsprojCorrector_SetLangVersion(CsprojConfigState configState, string langVersion)
        {
            CsprojCorrector csprojCorrector = new CsprojCorrector(this.PathToCsprojFile)
            {
                ConfigState = configState
            };

            csprojCorrector.SetLangVersion(langVersion);

            string actualLangVersion = csprojCorrector.GetLangVersion();

            Assert.Equal(expected: langVersion, actual: actualLangVersion);
        }
Example #3
0
        private static void Main()
        {
            string[] csprojFullPathes = Directory.GetFiles(RootFolderFullPath, "*.csproj", SearchOption.AllDirectories);

            foreach (var csprojFullPath in csprojFullPathes)
            {
                using (CsprojCorrector c = new CsprojCorrector(csprojFullPath))
                {
                    //c.SetLangVersion("default");
                    //Console.WriteLine($"{Path.GetFileName(csprojFullPath)} - {c.GetLangVersion()}");

                    c.RemoveAllCodeContractSettings();
                }
            }
        }