This repository has been archived by the owner on Nov 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors timeline integration tests to make it more pluggable
- Loading branch information
Showing
7 changed files
with
286 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
tests/Integration/EndPoints/HomePage/TimeLine/WithElements.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
using System.Collections.Generic; | ||
using PoLaKoSz.MusicFM.Models; | ||
|
||
namespace PoLaKoSz.MusicFM.Tests.Integration.EndPoints.HomePage.TimeLine | ||
{ | ||
class WithElements : TimeLineBase | ||
{ | ||
private static readonly List<Track> _raw; | ||
private static readonly List<Track> _cleaned; | ||
|
||
|
||
|
||
static WithElements() | ||
{ | ||
_raw = new List<Track>() | ||
{ | ||
new Track("MUSIC KILLERS LIVE", "AT THE TURNTABLE: NIGEL STATELY"), | ||
new Track("AT THE TURNTABLE", "NIGEL STATELY"), | ||
new Track("David Guetta Ft. Nicky Minaj & Jason Derulo", "Goodbye"), | ||
new Track("Zoli Vekony Ft. James Cash", "Moments"), | ||
new Track("Wellhello", "Odaút (Pixa Remix - Radio Edit)"), | ||
new Track("Radics Gigi & Talán Attila", "Fade Away"), | ||
new Track("(MK DJ) Willcox", "In My Head (Radio Edit)"), | ||
new Track("New Level Empire", "Homelights"), | ||
new Track("Cloud9+", "Scars"), | ||
new Track("Andrewboy", "Születésnapomra"), | ||
new Track("Anymood", "In Your Eyes"), | ||
new Track("Juli Fabian & Zoohacker", "Sizzlin' (Zoohacker Edit)"), | ||
new Track("Crazibiza And Block & Crown", "That Same Feeling (Luca Debonaire Remix)"), | ||
new Track("Metrush", "Cover It Up"), | ||
new Track("Cloud 9+ Ft. Járai Márk & Fura Csé", "Valaki mondja el"), | ||
new Track("Julian Kid", "Back 2 U"), | ||
new Track("T-Maniac", "Bang It Louder"), | ||
new Track("Király Viktor ft. DMC", "Running Out of Time"), | ||
new Track("Radics Gigi", "Budapest Szerelem"), | ||
new Track("Goldhand", "Believe In Me"), | ||
new Track("Kállay Saunders Band", "Juliet"), | ||
new Track("Pápai Joci", "Kirakós"), | ||
new Track("Wolf Kati", "What about my dreams"), | ||
new Track("Veréb Tamás", "Éjszakai járat"), | ||
new Track("Cubicore & Shane 54", "Budokan"), | ||
new Track("Kállay Saunders", "I Don't Really Care"), | ||
new Track("ByeAlex és a Slepp", "Menned kéne"), | ||
new Track("Martin Tay", "Be Proud (Canard Remix)"), | ||
new Track("(MK DJ) Willcox", "Tequila"), | ||
new Track("Edo Denova Ft. Tóth Andi", "Smells Like Teen Spirit"), | ||
new Track("Divello & Syntax feat. Chris L", "Long Way Home"), | ||
new Track("DRBRS, Fekete Vonat Ft. Halott Pénz", "Hol van az a lány"), | ||
new Track("Crazibiza", "Desert Storm"), | ||
new Track("Max & Sims", "Keep It Warm"), | ||
new Track("Unique", "Egy lépéssel a föld felett"), | ||
new Track("Kállay Saunders And Joe Dean", "Talk That"), | ||
new Track("The Biebers", "Rakjuk össze!"), | ||
new Track("Earth N Days", "Turkish Bazar"), | ||
new Track("Wellhello", "Az utolsó hibám"), | ||
new Track("Julian Kid", "Give It To Me (Radio Edit)"), | ||
new Track("Janicsák Veca", "Hazudjunk igazat"), | ||
new Track("Király Viktor", "Budapest Girl"), | ||
new Track("Cubicore & Shane 54", "Out Of Time"), | ||
new Track("Heincz Gábor 'Biga'", "Learning to Let Go"), | ||
new Track("Golden Life", "Family (Nigel Stately Remix)"), | ||
new Track("Follow The Flow", "Maradok távol"), | ||
new Track("Wellhello", "Odaút"), | ||
new Track("Post Malone", "Better Now"), | ||
new Track("DJ Khaled Ft. Rihanna & Bryson Tiller", "Wild Thoughts"), | ||
new Track("Rudimental Ft. James Arthur", "Sun Comes Up"), | ||
new Track("Rita Ora", "Let You Love Me"), | ||
new Track("Tiesto", "Jackie Chan (Clean Version)"), | ||
new Track("Marshmello And Bastille", "Happier"), | ||
new Track("Black Coffee And David Guetta Ft. Delilah Montagu", "Drive"), | ||
new Track("Don Diablo Ft. Emeli Sande & Gucci Mane", "Survive"), | ||
new Track("Sia", "Chandelier"), | ||
new Track("Train", "Shake Up Christmas"), | ||
new Track("Calvin Harris Ft. Sam Smith", "Promises"), | ||
new Track("Matoma & Enrique Iglesias", "I Don't Dance (Without You)"), | ||
new Track("Cheat Codes & Little Mix", "Only You"), | ||
new Track("Dom Dolla", "Take It"), | ||
new Track("P!nk", "Secrets"), | ||
new Track("G-Eazy feat. Halsey", "Him & I"), | ||
new Track("Alesso", "Remedy"), | ||
new Track("KAZKA", "Plakala"), | ||
new Track("Silk City ft. Dua Lipa", "Electricity"), | ||
new Track("Armin van Buuren Ft. Conrad", "Sex, Love and Water"), | ||
new Track("Marshmello And Bastille", "Happier"), | ||
new Track("Follow The Flow", "Anyám mondta"), | ||
new Track("Post Malone", "Better Now"), | ||
new Track("Lucas & Steve Ft. Brandy", "I Could Be Wrong"), | ||
new Track("(MK DJ) Antonyo", "Give Me The Night"), | ||
new Track("Kelly Clarkson", "Underneath the Tree"), | ||
new Track("Wellhello", "Nem olyan lány"), | ||
new Track("Fatboy Slim", "Praise You (Purple Disco Machine Remix)"), | ||
new Track("New Level Empire & Republic", "Valódi"), | ||
new Track("Radics Gigi", "Moment"), | ||
new Track("New Level Empire", "Odafuthatnánk"), | ||
new Track("Max & Sims", "Keep It Warm"), | ||
new Track("Zoli Vekony Ft. James Cash", "Moments"), | ||
new Track("New Level Empire", "Megtörténtünk"), | ||
new Track("(MK DJ) Willcox", "Tequila"), | ||
new Track("New Level Empire", "Valahol"), | ||
new Track("Gashi Ft. French Montana & Dj Snake", "Creep On Me"), | ||
new Track("Rita Ora", "Anywhere"), | ||
}; | ||
|
||
_cleaned = new List<Track>() | ||
{ | ||
new Track("David Guetta Ft. Nicky Minaj & Jason Derulo", "Goodbye"), | ||
new Track("Zoli Vekony Ft. James Cash", "Moments"), | ||
new Track("Wellhello", "Odaút (Pixa Remix - Radio Edit)"), | ||
new Track("Radics Gigi & Talán Attila", "Fade Away"), | ||
new Track("Willcox", "In My Head (Radio Edit)"), | ||
new Track("New Level Empire", "Homelights"), | ||
new Track("Cloud9+", "Scars"), | ||
new Track("Andrewboy", "Születésnapomra"), | ||
new Track("Anymood", "In Your Eyes"), | ||
new Track("Juli Fabian & Zoohacker", "Sizzlin' (Zoohacker Edit)"), | ||
new Track("Crazibiza And Block & Crown", "That Same Feeling (Luca Debonaire Remix)"), | ||
new Track("Metrush", "Cover It Up"), | ||
new Track("Cloud 9+ Ft. Járai Márk & Fura Csé", "Valaki mondja el"), | ||
new Track("Julian Kid", "Back 2 U"), | ||
new Track("T-Maniac", "Bang It Louder"), | ||
new Track("Király Viktor ft. DMC", "Running Out of Time"), | ||
new Track("Radics Gigi", "Budapest Szerelem"), | ||
new Track("Goldhand", "Believe In Me"), | ||
new Track("Kállay Saunders Band", "Juliet"), | ||
new Track("Pápai Joci", "Kirakós"), | ||
new Track("Wolf Kati", "What about my dreams"), | ||
new Track("Veréb Tamás", "Éjszakai járat"), | ||
new Track("Cubicore & Shane 54", "Budokan"), | ||
new Track("Kállay Saunders", "I Don't Really Care"), | ||
new Track("ByeAlex és a Slepp", "Menned kéne"), | ||
new Track("Martin Tay", "Be Proud (Canard Remix)"), | ||
new Track("Willcox", "Tequila"), | ||
new Track("Edo Denova Ft. Tóth Andi", "Smells Like Teen Spirit"), | ||
new Track("Divello & Syntax feat. Chris L", "Long Way Home"), | ||
new Track("DRBRS, Fekete Vonat Ft. Halott Pénz", "Hol van az a lány"), | ||
new Track("Crazibiza", "Desert Storm"), | ||
new Track("Max & Sims", "Keep It Warm"), | ||
new Track("Unique", "Egy lépéssel a föld felett"), | ||
new Track("Kállay Saunders And Joe Dean", "Talk That"), | ||
new Track("The Biebers", "Rakjuk össze!"), | ||
new Track("Earth N Days", "Turkish Bazar"), | ||
new Track("Wellhello", "Az utolsó hibám"), | ||
new Track("Julian Kid", "Give It To Me (Radio Edit)"), | ||
new Track("Janicsák Veca", "Hazudjunk igazat"), | ||
new Track("Király Viktor", "Budapest Girl"), | ||
new Track("Cubicore & Shane 54", "Out Of Time"), | ||
new Track("Heincz Gábor 'Biga'", "Learning to Let Go"), | ||
new Track("Golden Life", "Family (Nigel Stately Remix)"), | ||
new Track("Follow The Flow", "Maradok távol"), | ||
new Track("Wellhello", "Odaút"), | ||
new Track("Post Malone", "Better Now"), | ||
new Track("DJ Khaled Ft. Rihanna & Bryson Tiller", "Wild Thoughts"), | ||
new Track("Rudimental Ft. James Arthur", "Sun Comes Up"), | ||
new Track("Rita Ora", "Let You Love Me"), | ||
new Track("Tiesto", "Jackie Chan (Clean Version)"), | ||
new Track("Marshmello And Bastille", "Happier"), | ||
new Track("Black Coffee And David Guetta Ft. Delilah Montagu", "Drive"), | ||
new Track("Don Diablo Ft. Emeli Sande & Gucci Mane", "Survive"), | ||
new Track("Sia", "Chandelier"), | ||
new Track("Train", "Shake Up Christmas"), | ||
new Track("Calvin Harris Ft. Sam Smith", "Promises"), | ||
new Track("Matoma & Enrique Iglesias", "I Don't Dance (Without You)"), | ||
new Track("Cheat Codes & Little Mix", "Only You"), | ||
new Track("Dom Dolla", "Take It"), | ||
new Track("P!nk", "Secrets"), | ||
new Track("G-Eazy feat. Halsey", "Him & I"), | ||
new Track("Alesso", "Remedy"), | ||
new Track("KAZKA", "Plakala"), | ||
new Track("Silk City ft. Dua Lipa", "Electricity"), | ||
new Track("Armin van Buuren Ft. Conrad", "Sex, Love and Water"), | ||
new Track("Marshmello And Bastille", "Happier"), | ||
new Track("Follow The Flow", "Anyám mondta"), | ||
new Track("Post Malone", "Better Now"), | ||
new Track("Lucas & Steve Ft. Brandy", "I Could Be Wrong"), | ||
new Track("Antonyo", "Give Me The Night"), | ||
new Track("Kelly Clarkson", "Underneath the Tree"), | ||
new Track("Wellhello", "Nem olyan lány"), | ||
new Track("Fatboy Slim", "Praise You (Purple Disco Machine Remix)"), | ||
new Track("New Level Empire & Republic", "Valódi"), | ||
new Track("Radics Gigi", "Moment"), | ||
new Track("New Level Empire", "Odafuthatnánk"), | ||
new Track("Max & Sims", "Keep It Warm"), | ||
new Track("Zoli Vekony Ft. James Cash", "Moments"), | ||
new Track("New Level Empire", "Megtörténtünk"), | ||
new Track("Willcox", "Tequila"), | ||
new Track("New Level Empire", "Valahol"), | ||
new Track("Gashi Ft. French Montana & Dj Snake", "Creep On Me"), | ||
new Track("Rita Ora", "Anywhere"), | ||
}; | ||
} | ||
|
||
public WithElements() | ||
: base(_raw, _cleaned) | ||
{ | ||
base.SetResponseFromServer(@"HomePage\timeline.html"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using NUnit.Framework; | ||
using PoLaKoSz.MusicFM.Models; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace PoLaKoSz.MusicFM.Tests.Integration.EndPoints.HomePage | ||
{ | ||
abstract class TimeLineBase : TestClassBase | ||
{ | ||
private readonly PoLaKoSz.MusicFM.EndPoints.HomePage _homePage; | ||
private readonly List<Track> _raw; | ||
private readonly List<Track> _cleaned; | ||
|
||
|
||
|
||
public TimeLineBase(List<Track> raw, List<Track> cleaned) | ||
{ | ||
_homePage = new PoLaKoSz.MusicFM.EndPoints.HomePage(base.HttpClient); | ||
_raw = raw; | ||
_cleaned = cleaned; | ||
} | ||
|
||
|
||
|
||
[Test] | ||
public async Task Check_Cleaned_Tracklist_Count() | ||
{ | ||
var actual = await _homePage.Timeline(); | ||
|
||
Assert.That(actual.Count, Is.EqualTo(_cleaned.Count)); | ||
} | ||
|
||
[Test] | ||
public async Task Check_Raw_Tracklist_Count() | ||
{ | ||
var actual = await _homePage.Timeline(new CleanerMock()); | ||
|
||
Assert.That(actual.Count, Is.EqualTo(_raw.Count)); | ||
} | ||
|
||
[Test] | ||
public async Task Can_Parse_Timeline_Without_Any_Formatting() | ||
{ | ||
var actual = await _homePage.Timeline(new CleanerMock()); | ||
|
||
CollectionAssert.AreEqual(_raw, actual); | ||
} | ||
|
||
[Test] | ||
public async Task Can_Parse_Timeline_With_Formatting() | ||
{ | ||
var actual = await _homePage.Timeline(); | ||
|
||
CollectionAssert.AreEqual(_cleaned, actual); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters