Skip to content

Commit

Permalink
Merge pull request #2 from rickvdbosch/feature/improvements-202211
Browse files Browse the repository at this point in the history
Feature/improvements 202211
  • Loading branch information
rickvdbosch authored Nov 4, 2022
2 parents 7ddd7d6 + 186da4d commit 384a673
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.5.0
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
- name: Build
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build & Publish](https://github.com/rickvdbosch/scrapionize/actions/workflows/build-and-publish.yml/badge.svg)](https://github.com/rickvdbosch/scrapionize/actions/workflows/build-and-publish.yml)

# Scrapionize

Scrapionize (a Scraper for Sessionize) is a NuGet package to scrape a Sessionize CFP page and give you the basic information that's
Expand Down
6 changes: 3 additions & 3 deletions RvdB.Scrapionize/RvdB.Scrapionize.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Title>Scrapionize</Title>
<PackageVersion>1.4.0</PackageVersion>
<Version>1.4.0</Version>
<PackageVersion>1.5.0</PackageVersion>
<Version>1.5.0</Version>
<Authors>Rick van den Bosch</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/rickvdbosch/scrapionize</PackageProjectUrl>
<RepositoryUrl>https://github.com/rickvdbosch/scrapionize</RepositoryUrl>
<PackageTags>sessionize, parser, scraper, cfp</PackageTags>
<Description>Scrapionize (a Scraper for Sessionize) enables you to get basic CFP data from a Sessionize CFP page.</Description>
<Copyright>Copyright © 2021 - 2022 Rick van den Bosch</Copyright>
<PackageReleaseNotes>Fixed Code Smell, Updated packages</PackageReleaseNotes>
<PackageReleaseNotes>Added additional test cases</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<EnforceCodeStyleInBuild>False</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
Expand Down
8 changes: 6 additions & 2 deletions RvdB.Scrapionize/Scraper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ public SessionizeData Scrape(Uri url)
return result;
}

private static DateTime ParseSessionizeDate(string date)
#region Helper methods

private static DateTime ParseSessionizeDate(string date)
{
return DateTime.ParseExact(date, Constants.DATE_FORMAT, CultureInfo.InvariantCulture);
}
}

#endregion
}
}
31 changes: 31 additions & 0 deletions RvdB.Tests/ExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;

using Microsoft.Extensions.DependencyInjection;

using RvdB.Scrapionize.Extensions;
using RvdB.Scrapionize.Interfaces;

using Xunit;

namespace RvdB.Scrapionize.Tests
{
public class ExtensionsTests
{
[Fact]
public void WithNullIServiceCollection_AddScrapionize_ThrowsArgumentNullException()
{
IServiceCollection serviceCollection = null;

var exception = Assert.Throws<ArgumentNullException>(serviceCollection.AddScrapionize);
Assert.Equal("services", exception.ParamName);
}

[Fact]
public void WithValidIServiceCollection_AddScrapionize_AddsScrapionize()
{
IServiceCollection serviceCollection = new ServiceCollection();
serviceCollection.AddScrapionize();
Assert.Single(serviceCollection, s => s.ServiceType == typeof(IScraper));
}
}
}

0 comments on commit 384a673

Please sign in to comment.