From e7e3f93c57e99da7d3fe910d4ee50a883517d6eb Mon Sep 17 00:00:00 2001 From: Artem Votintsev Date: Sat, 22 Oct 2022 21:05:29 +0200 Subject: [PATCH 01/10] Update project to dotnet core --- RSS.Test/Properties/AssemblyInfo.cs | 35 ----------- RSS.Test/RSS.Test.csproj | 95 ++++++++++------------------- RSS.Test/RSSHelperTest.cs | 27 ++++---- RSS.Test/Validators/RssDateTest.cs | 59 +++++++++--------- RSS.Test/Validators/RssEmailTest.cs | 23 ++++--- RSS.Test/Validators/RssTtlTest.cs | 59 +++++++++--------- RSS.Test/Validators/RssUrlTest.cs | 43 +++++++------ RSS/Enumerators/Rel.cs | 8 ++- RSS/Properties/AssemblyInfo.cs | 36 ----------- RSS/RSS.csproj | 95 ++++++----------------------- RSS/Structure/RssLink.cs | 2 +- 11 files changed, 159 insertions(+), 323 deletions(-) delete mode 100644 RSS.Test/Properties/AssemblyInfo.cs delete mode 100644 RSS/Properties/AssemblyInfo.cs diff --git a/RSS.Test/Properties/AssemblyInfo.cs b/RSS.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 2b97b49..0000000 --- a/RSS.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RSS.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("RSS.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a6d27fe3-4400-485c-8f7a-81df08479499")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RSS.Test/RSS.Test.csproj b/RSS.Test/RSS.Test.csproj index 3a5de67..056d65f 100644 --- a/RSS.Test/RSS.Test.csproj +++ b/RSS.Test/RSS.Test.csproj @@ -1,69 +1,38 @@ - - + - Debug - AnyCPU - - - 2.0 - {100A2EBB-A674-4CBB-AA97-83811397C676} - Library - Properties - RSS.Test - RSS.Test - v4.0 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - + netcoreapp2.1 + 1.0.0 + RSS creator. + Artem Votintsev + Copyright © 2019 + Debug;Release + git + https://github.com/ApmeM/Simple-RSS + True + + - - - - 3.5 - + + + + - - False - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + - - - - - - - - - - {E43F1013-ADC6-45C8-829F-19CCC5C1D91F} - RSS - - - - - \ No newline at end of file + + + + + diff --git a/RSS.Test/RSSHelperTest.cs b/RSS.Test/RSSHelperTest.cs index 099fb3b..c92cdee 100644 --- a/RSS.Test/RSSHelperTest.cs +++ b/RSS.Test/RSSHelperTest.cs @@ -9,7 +9,7 @@ using System.Net; using System.Text; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using Xunit; using RSS.Enumerators; using RSS.Structure; @@ -17,12 +17,11 @@ #endregion - [TestClass] public class RSSHelperTest { #region Public Methods - [TestMethod] + [Fact] public void GetRSS_AllData_ValidRssXml() { MemoryStream ms = new MemoryStream(); @@ -31,10 +30,10 @@ public void GetRSS_AllData_ValidRssXml() RSSHelper.WriteRSS(rss, ms); var result = Encoding.UTF8.GetString(ms.GetBuffer()).Trim('\0'); - Assert.AreEqual(GetFullRSSText(), result); + Assert.Equal(GetFullRSSText(), result); } - [TestMethod] + [Fact] public void WriteRead_LargeObject_Ok() { MemoryStream ms = new MemoryStream(); @@ -44,10 +43,10 @@ public void WriteRead_LargeObject_Ok() ms.Position = 0; Rss newRss = RSSHelper.ReadRSS(ms); - Assert.AreEqual(rss.Channel.Description, newRss.Channel.Description); + Assert.Equal(rss.Channel.Description, newRss.Channel.Description); } - [TestMethod] + [Fact] public void Read_External_Ok() { MemoryStream ms = new MemoryStream(); @@ -56,12 +55,12 @@ public void Read_External_Ok() ms.Position = 0; Rss rss = RSSHelper.ReadRSS(ms); - Assert.AreEqual("channel title", rss.Channel.Title); - Assert.AreEqual("long description", rss.Channel.Description); + Assert.Equal("channel title", rss.Channel.Title); + Assert.Equal("long description", rss.Channel.Description); } /* - [TestMethod] + [Fact] public void Test() { var request = WebRequest.Create("http://bash.org.ru/rss/"); @@ -70,8 +69,8 @@ public void Test() Rss rss = RSSHelper.ReadRSS(stream); - Assert.AreEqual("Bash.Org.Ru", rss.Channel.Title); - Assert.AreEqual("Цитатник Рунета", rss.Channel.Description); + Assert.Equal("Bash.Org.Ru", rss.Channel.Title); + Assert.Equal("Цитатник Рунета", rss.Channel.Description); } */ @@ -82,7 +81,7 @@ private static Rss GetFullRSS() Channel = new RssChannel { - AtomLink = new RssLink { Href = new RssUrl("http://atomlink.com"), Rel = Rel.self, Type = "text/plain" }, + AtomLink = new RssLink { Href = new RssUrl("http://atomlink.com"), Rel = Rel.Self, Type = "text/plain" }, Category = "category", Cloud = new RssCloud @@ -160,7 +159,7 @@ private static string GetFullRSSText() { return @" - + category diff --git a/RSS.Test/Validators/RssDateTest.cs b/RSS.Test/Validators/RssDateTest.cs index d27db0b..ea8e016 100644 --- a/RSS.Test/Validators/RssDateTest.cs +++ b/RSS.Test/Validators/RssDateTest.cs @@ -3,15 +3,14 @@ namespace RSS.Test.Validators using System; using System.Globalization; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using Xunit; using RSS.Exceptions; using RSS.Structure.Validators; - [TestClass] public class RssDateTest { - [TestMethod] + [Fact] public void Ctor_ValidDateParameter_Ok() { // Arrange @@ -21,10 +20,10 @@ public void Ctor_ValidDateParameter_Ok() RssDate rssDate = new RssDate(date); // Assert - Assert.AreEqual(date, rssDate.Date); + Assert.Equal(date, rssDate.Date); } - [TestMethod] + [Fact] public void Ctor_DateInFuture_Error() { // Arrange @@ -42,10 +41,10 @@ public void Ctor_DateInFuture_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetDate_ValidDateParameter_Ok() { // Arrange @@ -56,10 +55,10 @@ public void SetDate_ValidDateParameter_Ok() rssDate.Date = date; // Assert - Assert.AreEqual(date, rssDate.Date); + Assert.Equal(date, rssDate.Date); } - [TestMethod] + [Fact] public void SetDate_DateInFuture_Error() { // Arrange @@ -78,10 +77,10 @@ public void SetDate_DateInFuture_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void Ctor_ValidStringParameter_Ok() { // Arrange @@ -91,10 +90,10 @@ public void Ctor_ValidStringParameter_Ok() RssDate rssDate = new RssDate(date); // Assert - Assert.AreEqual(date, rssDate.DateString); + Assert.Equal(date, rssDate.DateString); } - [TestMethod] + [Fact] public void Ctor_StringInFuture_Error() { // Arrange @@ -112,10 +111,10 @@ public void Ctor_StringInFuture_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetString_ValidStringParameter_Ok() { // Arrange @@ -126,10 +125,10 @@ public void SetString_ValidStringParameter_Ok() rssDate.DateString = date; // Assert - Assert.AreEqual(date, rssDate.DateString); + Assert.Equal(date, rssDate.DateString); } - [TestMethod] + [Fact] public void SetString_StringInFuture_Error() { // Arrange @@ -148,10 +147,10 @@ public void SetString_StringInFuture_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetDate_ConvertToString_String() { // Arrange @@ -162,10 +161,10 @@ public void SetDate_ConvertToString_String() rssDate.DateString = date.ToString("R"); // Assert - Assert.AreEqual(date, rssDate.Date); + Assert.Equal(date, rssDate.Date); } - [TestMethod] + [Fact] public void SetString_ConvertToDate_Date() { // Arrange @@ -176,10 +175,10 @@ public void SetString_ConvertToDate_Date() rssDate.Date = date; // Assert - Assert.AreEqual(date.ToString("R"), rssDate.DateString); + Assert.Equal(date.ToString("R"), rssDate.DateString); } - [TestMethod] + [Fact] public void SetString_Null_DateNull() { // Arrange @@ -189,10 +188,10 @@ public void SetString_Null_DateNull() rssDate.DateString = null; // Assert - Assert.AreEqual(null, rssDate.Date); + Assert.Null(rssDate.Date); } - [TestMethod] + [Fact] public void SetDate_Null_StringNull() { // Arrange @@ -202,10 +201,10 @@ public void SetDate_Null_StringNull() rssDate.Date = null; // Assert - Assert.AreEqual(null, rssDate.DateString); + Assert.Null(rssDate.DateString); } - [TestMethod] + [Fact] public void SetString_InvalidDateFormat_Error() { // Arrange @@ -224,10 +223,10 @@ public void SetString_InvalidDateFormat_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void Ctor_InvalidDateFormat_Error() { // Arrange @@ -245,7 +244,7 @@ public void Ctor_InvalidDateFormat_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } } } \ No newline at end of file diff --git a/RSS.Test/Validators/RssEmailTest.cs b/RSS.Test/Validators/RssEmailTest.cs index 8b21971..b2cbb7b 100644 --- a/RSS.Test/Validators/RssEmailTest.cs +++ b/RSS.Test/Validators/RssEmailTest.cs @@ -1,14 +1,13 @@ namespace RSS.Test.Validators { - using Microsoft.VisualStudio.TestTools.UnitTesting; + using Xunit; using RSS.Exceptions; using RSS.Structure.Validators; - [TestClass] public class RssEmailTest { - [TestMethod] + [Fact] public void Ctor_ValidEmailParameter_Ok() { // Arrange @@ -18,10 +17,10 @@ public void Ctor_ValidEmailParameter_Ok() RssEmail rssEmail = new RssEmail(Email); // Assert - Assert.AreEqual(Email, rssEmail.Email); + Assert.Equal(Email, rssEmail.Email); } - [TestMethod] + [Fact] public void Ctor_InvalidEmail_Error() { // Arrange @@ -39,10 +38,10 @@ public void Ctor_InvalidEmail_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetEmail_ValidDateParameter_Ok() { // Arrange @@ -53,10 +52,10 @@ public void SetEmail_ValidDateParameter_Ok() rssEmail.Email = Email; // Assert - Assert.AreEqual(Email, rssEmail.Email); + Assert.Equal(Email, rssEmail.Email); } - [TestMethod] + [Fact] public void SetEmail_InvalidEmail_Error() { // Arrange @@ -75,10 +74,10 @@ public void SetEmail_InvalidEmail_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetString_Null_StringNull() { // Arrange @@ -88,7 +87,7 @@ public void SetString_Null_StringNull() rssEmail.Email = null; // Assert - Assert.AreEqual(null, rssEmail.Email); + Assert.Null(rssEmail.Email); } } } \ No newline at end of file diff --git a/RSS.Test/Validators/RssTtlTest.cs b/RSS.Test/Validators/RssTtlTest.cs index 0227820..cf94300 100644 --- a/RSS.Test/Validators/RssTtlTest.cs +++ b/RSS.Test/Validators/RssTtlTest.cs @@ -3,15 +3,14 @@ namespace RSS.Test.Validators using System; using System.Globalization; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using Xunit; using RSS.Exceptions; using RSS.Structure.Validators; - [TestClass] public class RssTtlTest { - [TestMethod] + [Fact] public void Ctor_ValidTtlParameter_Ok() { // Arrange @@ -21,10 +20,10 @@ public void Ctor_ValidTtlParameter_Ok() RssTtl rssTtl = new RssTtl(TTL); // Assert - Assert.AreEqual(TTL, rssTtl.TTL); + Assert.Equal(TTL, rssTtl.TTL); } - [TestMethod] + [Fact] public void Ctor_TtlLessZero_Error() { // Arrange @@ -42,10 +41,10 @@ public void Ctor_TtlLessZero_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetTtl_ValidTtlParameter_Ok() { // Arrange @@ -56,10 +55,10 @@ public void SetTtl_ValidTtlParameter_Ok() rssTtl.TTL = TTL; // Assert - Assert.AreEqual(TTL, rssTtl.TTL); + Assert.Equal(TTL, rssTtl.TTL); } - [TestMethod] + [Fact] public void SetTtl_TtlLessZero_Error() { // Arrange @@ -78,10 +77,10 @@ public void SetTtl_TtlLessZero_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void Ctor_ValidStringParameter_Ok() { // Arrange @@ -91,10 +90,10 @@ public void Ctor_ValidStringParameter_Ok() RssTtl rssTtl = new RssTtl(TTL); // Assert - Assert.AreEqual(TTL, rssTtl.TTLString); + Assert.Equal(TTL, rssTtl.TTLString); } - [TestMethod] + [Fact] public void Ctor_StringLessZero_Error() { // Arrange @@ -112,10 +111,10 @@ public void Ctor_StringLessZero_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetString_ValidStringParameter_Ok() { // Arrange @@ -126,10 +125,10 @@ public void SetString_ValidStringParameter_Ok() rssTtl.TTLString = TTL; // Assert - Assert.AreEqual(TTL, rssTtl.TTLString); + Assert.Equal(TTL, rssTtl.TTLString); } - [TestMethod] + [Fact] public void SetString_StringLessZero_Error() { // Arrange @@ -148,10 +147,10 @@ public void SetString_StringLessZero_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void SetTtl_ConvertToString_String() { // Arrange @@ -162,10 +161,10 @@ public void SetTtl_ConvertToString_String() rssTtl.TTLString = TTL.ToString(); // Assert - Assert.AreEqual(TTL, rssTtl.TTL); + Assert.Equal(TTL, rssTtl.TTL); } - [TestMethod] + [Fact] public void SetString_ConvertToTtl_Ttl() { // Arrange @@ -176,10 +175,10 @@ public void SetString_ConvertToTtl_Ttl() rssTtl.TTL = TTL; // Assert - Assert.AreEqual(TTL.ToString(), rssTtl.TTLString); + Assert.Equal(TTL.ToString(), rssTtl.TTLString); } - [TestMethod] + [Fact] public void SetString_Null_TtlZero() { // Arrange @@ -189,10 +188,10 @@ public void SetString_Null_TtlZero() rssTtl.TTLString = null; // Assert - Assert.AreEqual(0, rssTtl.TTL); + Assert.Equal(0, rssTtl.TTL); } - [TestMethod] + [Fact] public void SetTtl_Zero_StringNull() { // Arrange @@ -202,10 +201,10 @@ public void SetTtl_Zero_StringNull() rssTtl.TTL = 0; // Assert - Assert.AreEqual(null, rssTtl.TTLString); + Assert.Null(rssTtl.TTLString); } - [TestMethod] + [Fact] public void SetString_InvalidTtlFormat_Error() { // Arrange @@ -224,10 +223,10 @@ public void SetString_InvalidTtlFormat_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void Ctor_InvalidTtlFormat_Error() { // Arrange @@ -245,7 +244,7 @@ public void Ctor_InvalidTtlFormat_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } } } \ No newline at end of file diff --git a/RSS.Test/Validators/RssUrlTest.cs b/RSS.Test/Validators/RssUrlTest.cs index db98a12..7eec280 100644 --- a/RSS.Test/Validators/RssUrlTest.cs +++ b/RSS.Test/Validators/RssUrlTest.cs @@ -3,15 +3,14 @@ namespace RSS.Test.Validators using System; using System.Globalization; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using Xunit; using RSS.Exceptions; using RSS.Structure.Validators; - [TestClass] public class RssUrlTest { - [TestMethod] + [Fact] public void Ctor_ValidUriParameter_Ok() { // Arrange @@ -21,10 +20,10 @@ public void Ctor_ValidUriParameter_Ok() RssUrl rssUrl = new RssUrl(uri); // Assert - Assert.AreEqual(uri, rssUrl.Url); + Assert.Equal(uri, rssUrl.Url); } - [TestMethod] + [Fact] public void SetUri_ValidUriParameter_Ok() { // Arrange @@ -35,10 +34,10 @@ public void SetUri_ValidUriParameter_Ok() rssUrl.Url = uri; // Assert - Assert.AreEqual(uri, rssUrl.Url); + Assert.Equal(uri, rssUrl.Url); } - [TestMethod] + [Fact] public void Ctor_ValidStringParameter_Ok() { // Arrange @@ -48,10 +47,10 @@ public void Ctor_ValidStringParameter_Ok() RssUrl rssUrl = new RssUrl(uri); // Assert - Assert.AreEqual(uri, rssUrl.UrlString); + Assert.Equal(uri, rssUrl.UrlString); } - [TestMethod] + [Fact] public void SetString_ValidStringParameter_Ok() { // Arrange @@ -62,10 +61,10 @@ public void SetString_ValidStringParameter_Ok() rssUrl.UrlString = uri; // Assert - Assert.AreEqual(uri, rssUrl.UrlString); + Assert.Equal(uri, rssUrl.UrlString); } - [TestMethod] + [Fact] public void SetUri_ConvertToString_String() { // Arrange @@ -76,10 +75,10 @@ public void SetUri_ConvertToString_String() rssUrl.UrlString = uri.AbsoluteUri; // Assert - Assert.AreEqual(uri, rssUrl.Url); + Assert.Equal(uri, rssUrl.Url); } - [TestMethod] + [Fact] public void SetString_ConvertToUri_Uri() { // Arrange @@ -90,10 +89,10 @@ public void SetString_ConvertToUri_Uri() rssUrl.Url = uri; // Assert - Assert.AreEqual(uri.AbsoluteUri, rssUrl.UrlString); + Assert.Equal(uri.AbsoluteUri, rssUrl.UrlString); } - [TestMethod] + [Fact] public void SetString_Null_UriNull() { // Arrange @@ -103,10 +102,10 @@ public void SetString_Null_UriNull() rssUrl.UrlString = null; // Assert - Assert.AreEqual(null, rssUrl.Url); + Assert.Null(rssUrl.Url); } - [TestMethod] + [Fact] public void SetUri_Null_StringNull() { // Arrange @@ -116,10 +115,10 @@ public void SetUri_Null_StringNull() rssUrl.Url = null; // Assert - Assert.AreEqual(null, rssUrl.UrlString); + Assert.Null(rssUrl.UrlString); } - [TestMethod] + [Fact] public void SetString_InvalidUriFormat_Error() { // Arrange @@ -138,10 +137,10 @@ public void SetString_InvalidUriFormat_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } - [TestMethod] + [Fact] public void Ctor_InvalidUriFormat_Error() { // Arrange @@ -159,7 +158,7 @@ public void Ctor_InvalidUriFormat_Error() } // Assert - Assert.IsNotNull(e); + Assert.NotNull(e); } } } \ No newline at end of file diff --git a/RSS/Enumerators/Rel.cs b/RSS/Enumerators/Rel.cs index bacc7fa..73e997a 100644 --- a/RSS/Enumerators/Rel.cs +++ b/RSS/Enumerators/Rel.cs @@ -1,8 +1,12 @@ +using System.Xml.Serialization; + namespace RSS.Enumerators { public enum Rel { - self, - alternate + [XmlEnum("self")] + Self, + [XmlEnum("alternate")] + Alternate } } \ No newline at end of file diff --git a/RSS/Properties/AssemblyInfo.cs b/RSS/Properties/AssemblyInfo.cs deleted file mode 100644 index 7f4a0a9..0000000 --- a/RSS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RSS")] -[assembly: AssemblyDescription("RSS creator")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("ApmeM")] -[assembly: AssemblyProduct("RSS")] -[assembly: AssemblyCopyright("Copyright © ApmeM 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c8f2205b-1730-4da1-b837-2f6a14ac449b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RSS/RSS.csproj b/RSS/RSS.csproj index 791e6f4..2f2e025 100644 --- a/RSS/RSS.csproj +++ b/RSS/RSS.csproj @@ -1,83 +1,22 @@ - - + + - Debug - AnyCPU - 9.0.30729 - 2.0 - {E43F1013-ADC6-45C8-829F-19CCC5C1D91F} - Library - Properties - RSS - RSS - v3.5 - 512 - - - 3.5 - + netstandard2.0 + 1.0.0 + RSS creator. + Artem Votintsev + Copyright © 2019 + Debug;Release + git + https://github.com/ApmeM/Simple-RSS + True - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - 3.5 - - - 3.5 - - - 3.5 - - - - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + \ No newline at end of file diff --git a/RSS/Structure/RssLink.cs b/RSS/Structure/RssLink.cs index e1fadbf..67ca0a3 100644 --- a/RSS/Structure/RssLink.cs +++ b/RSS/Structure/RssLink.cs @@ -19,7 +19,7 @@ public class RssLink public RssLink() { this.Type = "application/rss+xml"; - this.Rel = Rel.self; + this.Rel = Rel.Self; } #endregion From a862d8e03917f89932e3686562c22f603d4f2405 Mon Sep 17 00:00:00 2001 From: Artem Votintsev Date: Sat, 22 Oct 2022 21:23:10 +0200 Subject: [PATCH 02/10] Add project build --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e808b89 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: Build + +on: + push: + tags: v* + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Setup dotnet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.2.108 + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: Test with nunit + run: dotnet test --verbosity normal + + - name: Pack with nuget + run: dotnet pack --configuration=Release -p:PackageVersion=$Env:GITHUB_REF.substring(11) + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: artifacts + path: ./bin/Release/ + + - name: Setup nuget + uses: nuget/setup-nuget@v1 + with: + nuget-version: 'latest' + + - name: Setup nuget config + run: nuget.exe sources add -name github -source "https://nuget.pkg.github.com/apmem/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} + + - name: Upload to GitHub Packages + run: | + for f in ./artifacts/*.nupkg + do + nuget push $f -Source "github" + done + shell: bash \ No newline at end of file From 74ce743420e067dbfc22b8484bffcd0937bf0fb0 Mon Sep 17 00:00:00 2001 From: Artem Votintsev Date: Sat, 22 Oct 2022 21:34:25 +0200 Subject: [PATCH 03/10] Add build on push --- .github/workflows/build.yml | 23 ++++++----------- .github/workflows/pack.yml | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/pack.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e808b89..404c980 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,11 @@ name: Build -on: - push: - tags: v* - +on: push + jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - name: checkout @@ -25,13 +23,13 @@ jobs: run: dotnet test --verbosity normal - name: Pack with nuget - run: dotnet pack --configuration=Release -p:PackageVersion=$Env:GITHUB_REF.substring(11) + run: dotnet pack --configuration=Release -o ../artifacts/ - name: Upload artifact uses: actions/upload-artifact@v1 with: name: artifacts - path: ./bin/Release/ + path: ./artifacts/ - name: Setup nuget uses: nuget/setup-nuget@v1 @@ -39,12 +37,5 @@ jobs: nuget-version: 'latest' - name: Setup nuget config - run: nuget.exe sources add -name github -source "https://nuget.pkg.github.com/apmem/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} - - - name: Upload to GitHub Packages - run: | - for f in ./artifacts/*.nupkg - do - nuget push $f -Source "github" - done - shell: bash \ No newline at end of file + run: nuget sources add -name github -source "https://nuget.pkg.github.com/apmem/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml new file mode 100644 index 0000000..59a065b --- /dev/null +++ b/.github/workflows/pack.yml @@ -0,0 +1,50 @@ +name: Pack + +on: + push: + tags: v* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Setup dotnet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.2.108 + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: Test with nunit + run: dotnet test --verbosity normal + + - name: Pack with nuget + run: dotnet pack --configuration=Release -p:PackageVersion=${GITHUB_REF:11} -o ../artifacts/ + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: artifacts + path: ./artifacts/ + + - name: Setup nuget + uses: nuget/setup-nuget@v1 + with: + nuget-version: 'latest' + + - name: Setup nuget config + run: nuget sources add -name github -source "https://nuget.pkg.github.com/apmem/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} + + - name: Upload to GitHub Packages + run: | + for f in ./artifacts/*.nupkg + do + nuget push $f -Source "github" + done + shell: bash \ No newline at end of file From 45a412c045124551cbc94fa01ab2384861be6f8c Mon Sep 17 00:00:00 2001 From: Artem Votintsev Date: Sat, 22 Oct 2022 22:41:49 +0200 Subject: [PATCH 04/10] remove bash.org.ru from readme --- README.md | 4 ++-- RSS.Test/RSSHelperTest.cs | 15 --------------- RSS/Structure/RssChannel.cs | 2 +- RSS/Structure/RssLink.cs | 2 +- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6e0990a..8359063 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ To create rss feed you need to fill necessary fields in `Rss` object and call `R To read foreign rss feed you need to get stream with rss data and call `RSSHelper.ReadRSS` - var request = WebRequest.Create("http://bash.org.ru/rss/"); + var request = WebRequest.Create("http://example.org/rss/"); var response = request.GetResponse(); var stream = response.GetResponseStream(); Rss rss = RSSHelper.ReadRSS(stream); - Assert.AreEqual("Bash.Org.Ru", rss.Channel.Title); + Assert.AreEqual("Example", rss.Channel.Title); ### RSS object creating example diff --git a/RSS.Test/RSSHelperTest.cs b/RSS.Test/RSSHelperTest.cs index c92cdee..8d15b5b 100644 --- a/RSS.Test/RSSHelperTest.cs +++ b/RSS.Test/RSSHelperTest.cs @@ -59,21 +59,6 @@ public void Read_External_Ok() Assert.Equal("long description", rss.Channel.Description); } -/* - [Fact] - public void Test() - { - var request = WebRequest.Create("http://bash.org.ru/rss/"); - var response = request.GetResponse(); - var stream = response.GetResponseStream(); - - Rss rss = RSSHelper.ReadRSS(stream); - - Assert.Equal("Bash.Org.Ru", rss.Channel.Title); - Assert.Equal("Цитатник Рунета", rss.Channel.Description); - } -*/ - private static Rss GetFullRSS() { return new Rss diff --git a/RSS/Structure/RssChannel.cs b/RSS/Structure/RssChannel.cs index f241dc7..d1e10a4 100644 --- a/RSS/Structure/RssChannel.cs +++ b/RSS/Structure/RssChannel.cs @@ -34,7 +34,7 @@ public RssChannel() #region Properties /// - /// Gets or sets <atom:link href = "http://bash.org.ru/rss/" rel = "self" type = "application/rss+xml" /> + /// Gets or sets <atom:link href = "http://example/rss/" rel = "self" type = "application/rss+xml" /> /// [XmlElement("link", Namespace = "http://www.w3.org/2005/Atom")] public RssLink AtomLink { get; set; } diff --git a/RSS/Structure/RssLink.cs b/RSS/Structure/RssLink.cs index 67ca0a3..c806e02 100644 --- a/RSS/Structure/RssLink.cs +++ b/RSS/Structure/RssLink.cs @@ -10,7 +10,7 @@ #endregion /// - /// <atom:link href = "http://bash.org.ru/rss/" rel = "self" type = "application/rss+xml" /> + /// <atom:link href = "http://example.org/rss/" rel = "self" type = "application/rss+xml" /> /// public class RssLink { From 40c7d1db60e96dbb05d2ef6a0be3d58c6ead211b Mon Sep 17 00:00:00 2001 From: Andrew Gubskiy Date: Sun, 5 Mar 2023 16:42:36 +0200 Subject: [PATCH 05/10] Remove upstream build configuration --- .github/workflows/build.yml | 41 ------------------------------ .github/workflows/pack.yml | 50 ------------------------------------- 2 files changed, 91 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/pack.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 404c980..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build - -on: push - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: checkout - uses: actions/checkout@v1 - - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 2.2.108 - - - name: Build with dotnet - run: dotnet build --configuration Release - - - name: Test with nunit - run: dotnet test --verbosity normal - - - name: Pack with nuget - run: dotnet pack --configuration=Release -o ../artifacts/ - - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: artifacts - path: ./artifacts/ - - - name: Setup nuget - uses: nuget/setup-nuget@v1 - with: - nuget-version: 'latest' - - - name: Setup nuget config - run: nuget sources add -name github -source "https://nuget.pkg.github.com/apmem/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml deleted file mode 100644 index 59a065b..0000000 --- a/.github/workflows/pack.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Pack - -on: - push: - tags: v* - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: checkout - uses: actions/checkout@v1 - - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 2.2.108 - - - name: Build with dotnet - run: dotnet build --configuration Release - - - name: Test with nunit - run: dotnet test --verbosity normal - - - name: Pack with nuget - run: dotnet pack --configuration=Release -p:PackageVersion=${GITHUB_REF:11} -o ../artifacts/ - - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: artifacts - path: ./artifacts/ - - - name: Setup nuget - uses: nuget/setup-nuget@v1 - with: - nuget-version: 'latest' - - - name: Setup nuget config - run: nuget sources add -name github -source "https://nuget.pkg.github.com/apmem/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }} - - - name: Upload to GitHub Packages - run: | - for f in ./artifacts/*.nupkg - do - nuget push $f -Source "github" - done - shell: bash \ No newline at end of file From e7d53cdf76eec2ea830811ca6da02cd6cb4e7eed Mon Sep 17 00:00:00 2001 From: Andrew Gubskiy Date: Sun, 5 Mar 2023 16:45:40 +0200 Subject: [PATCH 06/10] Update solution --- X.Web.RSS.sln | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/X.Web.RSS.sln b/X.Web.RSS.sln index 89a1dc0..0a24ea9 100644 --- a/X.Web.RSS.sln +++ b/X.Web.RSS.sln @@ -12,6 +12,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .gitignore = .gitignore EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{738DC914-F2F1-47DA-B96F-80F19ECA01C0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0C7B1C4A-61AE-4F43-96F8-3CD6A5774C9E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,4 +40,8 @@ Global GlobalSection(TestCaseManagementSettings) = postSolution CategoryFile = cs-rss.vsmdi EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {301677B9-1586-4043-90C3-52A164230723} = {738DC914-F2F1-47DA-B96F-80F19ECA01C0} + {100A2EBB-A674-4CBB-AA97-83811397C676} = {0C7B1C4A-61AE-4F43-96F8-3CD6A5774C9E} + EndGlobalSection EndGlobal From 42e8c33ffd5d44d8e20d4d0756c5e324475ecefc Mon Sep 17 00:00:00 2001 From: Andrew Gubskiy Date: Sun, 5 Mar 2023 16:47:08 +0200 Subject: [PATCH 07/10] Update project settings --- X.Web.RSS.sln | 2 ++ src/X.Web.RSS/X.Web.RSS.csproj | 4 ++-- tests/X.Web.RSS.Tests/X.Web.RSS.Tests.csproj | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/X.Web.RSS.sln b/X.Web.RSS.sln index 0a24ea9..2e222c8 100644 --- a/X.Web.RSS.sln +++ b/X.Web.RSS.sln @@ -10,6 +10,8 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{04A264AA-7673-4212-BA17-41E6D01500FD}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + LICENSE = LICENSE + README.md = README.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{738DC914-F2F1-47DA-B96F-80F19ECA01C0}" diff --git a/src/X.Web.RSS/X.Web.RSS.csproj b/src/X.Web.RSS/X.Web.RSS.csproj index 0835d85..2868c27 100644 --- a/src/X.Web.RSS/X.Web.RSS.csproj +++ b/src/X.Web.RSS/X.Web.RSS.csproj @@ -1,7 +1,6 @@  - netstandard2.0 2.4.0 beta X.Web.RSS allow quickly and easily generate RSS feeds. @@ -17,10 +16,11 @@ default enable rss, xml + net6.0;net7.0;netstandard2.0;netstandard2.1 - + diff --git a/tests/X.Web.RSS.Tests/X.Web.RSS.Tests.csproj b/tests/X.Web.RSS.Tests/X.Web.RSS.Tests.csproj index 795d560..95106e5 100644 --- a/tests/X.Web.RSS.Tests/X.Web.RSS.Tests.csproj +++ b/tests/X.Web.RSS.Tests/X.Web.RSS.Tests.csproj @@ -3,10 +3,11 @@ net6.0 false + default - + all From bcd9c45fc61c0fa0692ba5084ee90e7e90a281ba Mon Sep 17 00:00:00 2001 From: Andrew Gubskiy Date: Sun, 5 Mar 2023 16:47:25 +0200 Subject: [PATCH 08/10] Remove azure-pipelines.yml --- azure-pipelines.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index fa5c702..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,14 +0,0 @@ -# .NET Core -# Build and test .NET Core projects -# Add steps that run tests, create a NuGet package, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core - -pool: - vmImage: 'Ubuntu 16.04' - -variables: - buildConfiguration: 'Release' - -steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' From c889aeb0bd306e3155cf12059001a0aa7d60e6a5 Mon Sep 17 00:00:00 2001 From: Andrew Gubskiy Date: Sun, 5 Mar 2023 16:50:40 +0200 Subject: [PATCH 09/10] Update version --- src/X.Web.RSS/X.Web.RSS.csproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/X.Web.RSS/X.Web.RSS.csproj b/src/X.Web.RSS/X.Web.RSS.csproj index 2868c27..7252b3a 100644 --- a/src/X.Web.RSS/X.Web.RSS.csproj +++ b/src/X.Web.RSS/X.Web.RSS.csproj @@ -1,7 +1,7 @@  - 2.4.0 + 2.5.0 beta X.Web.RSS allow quickly and easily generate RSS feeds. Andrew Gubskiy @@ -17,6 +17,10 @@ enable rss, xml net6.0;net7.0;netstandard2.0;netstandard2.1 + X.Web.RSS + https://raw.githubusercontent.com/dncuug/X.Web.RSS/master/README.md + 2.5.0.0 + 2.5.0.0 From 975f06e1cdc01baebcbfd8d8e84f82b49aea002b Mon Sep 17 00:00:00 2001 From: Andrew Gubskiy Date: Sun, 5 Mar 2023 16:52:57 +0200 Subject: [PATCH 10/10] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 0e8af32..f2d8ee4 100644 --- a/README.md +++ b/README.md @@ -103,3 +103,8 @@ Complete rss object will looks like this: } } }; + +## Get a digital subscription for project news +[Subscribe](https://twitter.com/intent/user?screen_name=andrew_gubskiy) to my Twitter to keep up-to-date with project news and receive announcements. + +[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/andrew_gubskiy.svg?style=social&label=Follow%20%40andrew_gubskiy)](https://twitter.com/andrew_gubskiy) \ No newline at end of file