コード例 #1
0
        public void IsApplicableTest()
        {
            string notApplicableInput = @"<?xml version=""1.0"" encoding=""utf - 8""?>
                            <Project Sdk = ""Microsoft.NET.Sdk.Web"">
                              <ItemGroup>
                                <PackageReference Include = ""Microsoft.CSharp"" Version = ""4.7.0"" />
                                <PackageReference Include = ""Serilog"" Version = ""2.8.0"" />
                              </ItemGroup>
                            </Project>";

            Assert.True(WCFUpdateChecker.IsProjFileApplicable(XDocument.Parse(Input)));
            Assert.False(WCFUpdateChecker.IsProjFileApplicable(XDocument.Parse(notApplicableInput)));
        }
コード例 #2
0
        public void IsApplicableTest()
        {
            string notApplicableInput = @"using Serilog;
                using System;
                using System.IO;
                namespace SampleServer
                {
                    class Program
                    {
                        static void Main()
                        {
                            Console.Writeline(""Service Listening...Press enter to exit."")
                            Console.ReadLine();
                        }
                    }
                }";

            Assert.True(WCFUpdateChecker.IsSourceCodeApplicable(CSharpSyntaxTree.ParseText(Input)));
            Assert.False(WCFUpdateChecker.IsSourceCodeApplicable(CSharpSyntaxTree.ParseText(notApplicableInput)));
        }
コード例 #3
0
 public void IsApplicableTest()
 {
     Assert.True(WCFUpdateChecker.IsConfigApplicable(XDocument.Parse(Input)));
     Assert.False(WCFUpdateChecker.IsConfigApplicable(XDocument.Parse(NotApplicableInput)));
 }