Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using SamSmithNZ.Service.DataAccess.FooFighters;
using SamSmithNZ.Service.DataAccess.FooFighters.Interfaces;
using SamSmithNZ.Service.Models.FooFighters;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SamSmithNZ.Service.Controllers.FooFighters
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using SamSmithNZ.Service.DataAccess.FooFighters;
using SamSmithNZ.Service.DataAccess.FooFighters.Interfaces;
using SamSmithNZ.Service.Models.FooFighters;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SamSmithNZ.Service.Controllers.FooFighters
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using SamSmithNZ.Service.DataAccess.FooFighters;
using SamSmithNZ.Service.DataAccess.FooFighters.Interfaces;
using SamSmithNZ.Service.Models.FooFighters;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SamSmithNZ.Service.Controllers.FooFighters
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using SamSmithNZ.Service.DataAccess.FooFighters;
using SamSmithNZ.Service.DataAccess.FooFighters.Interfaces;
using SamSmithNZ.Service.Models.FooFighters;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SamSmithNZ.Service.Controllers.FooFighters
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using SamSmithNZ.Service.DataAccess.FooFighters;
using SamSmithNZ.Service.DataAccess.FooFighters.Interfaces;
using SamSmithNZ.Service.Models.FooFighters;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SamSmithNZ.Service.Controllers.FooFighters
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ public class AlbumDataAccess : BaseDataAccess<Album>, IAlbumDataAccess
{
public AlbumDataAccess(IConfiguration configuration)
{
base.SetupConnectionString(configuration);
SetupConnectionString(configuration);
}

public async Task<List<Album>> GetList()
{
return await base.GetList("FFL_GetAlbums");
return await GetList("FFL_GetAlbums");
}

public async Task<Album> GetItem(int albumCode)
{
DynamicParameters parameters = new();
parameters.Add("@albumCode", albumCode, DbType.Int32);

return await base.GetItem("FFL_GetAlbums", parameters);
return await GetItem("FFL_GetAlbums", parameters);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class AverageSetlistDataAccess : BaseDataAccess<AverageSetlist>, IAverage
{
public AverageSetlistDataAccess(IConfiguration configuration)
{
base.SetupConnectionString(configuration);
SetupConnectionString(configuration);
}

public async Task<List<AverageSetlist>> GetList(int yearCode, int minimumSongCount, bool showAllSongs)
Expand All @@ -23,7 +23,7 @@ public async Task<List<AverageSetlist>> GetList(int yearCode, int minimumSongCou
parameters.Add("@ShowMinimumSongCount", minimumSongCount, DbType.Int32);
parameters.Add("@ShowAllSongs", showAllSongs, DbType.Boolean);

return await base.GetList("FFL_GetAverageSetlist", parameters);
return await GetList("FFL_GetAverageSetlist", parameters);
}

}
Expand Down
12 changes: 6 additions & 6 deletions src/SamSmithNZ.Service/DataAccess/FooFighters/ShowDataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,39 @@ public class ShowDataAccess : BaseDataAccess<Show>, IShowDataAccess
{
public ShowDataAccess(IConfiguration configuration)
{
base.SetupConnectionString(configuration);
SetupConnectionString(configuration);
}

public async Task<List<Show>> GetListByYearAsync(int yearCode)
{
DynamicParameters parameters = new();
parameters.Add("@yearCode", yearCode, DbType.Int32);

return await base.GetList("FFL_GetShows", parameters);
return await GetList("FFL_GetShows", parameters);
}

public async Task<List<Show>> GetListBySongAsync(int songCode)
{
DynamicParameters parameters = new();
parameters.Add("@songCode", songCode, DbType.Int32);

return await base.GetList("FFL_GetShows", parameters);
return await GetList("FFL_GetShows", parameters);
}

public async Task<List<Show>> GetListByFFLCode()
{
DynamicParameters parameters = new();
parameters.Add("@GetFFLCodes", true, DbType.Int32);

return await base.GetList("FFL_GetShows", parameters);
return await GetList("FFL_GetShows", parameters);
}

public async Task<Show> GetItem(int showCode)
{
DynamicParameters parameters = new();
parameters.Add("@showCode", showCode, DbType.Int32);

return await base.GetItem("FFL_GetShows", parameters);
return await GetItem("FFL_GetShows", parameters);
}

public async Task<bool> SaveItem(Show show)
Expand All @@ -57,7 +57,7 @@ public async Task<bool> SaveItem(Show show)
parameters.Add("@ShowCity", show.ShowCity, DbType.String);
parameters.Add("@ShowCountry", show.ShowCountry, DbType.String);

return await base.SaveItem("FFL_SaveShow", parameters);
return await SaveItem("FFL_SaveShow", parameters);
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/SamSmithNZ.Service/DataAccess/FooFighters/SongDataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ public class SongDataAccess : BaseDataAccess<Song>, ISongDataAccess
{
public SongDataAccess(IConfiguration configuration)
{
base.SetupConnectionString(configuration);
SetupConnectionString(configuration);
}

public async Task<List<Song>> GetList()
{
return await base.GetList("FFL_GetSongs");
return await GetList("FFL_GetSongs");
}

public async Task<List<Song>> GetListForAlbumAsync(int albumCode)
{
DynamicParameters parameters = new();
parameters.Add("@AlbumCode", albumCode, DbType.Int32);

return await base.GetList("FFL_GetSongs", parameters);
return await GetList("FFL_GetSongs", parameters);
}

public async Task<List<Song>> GetListForShowAsync(int showCode)
{
DynamicParameters parameters = new();
parameters.Add("@ShowCode", showCode, DbType.Int32);

return await base.GetList("FFL_GetSongs", parameters);
return await GetList("FFL_GetSongs", parameters);
}

public async Task<Song> GetItem(int songCode)
{
DynamicParameters parameters = new();
parameters.Add("@SongCode", songCode, DbType.Int32);

return await base.GetItem("FFL_GetSongs", parameters);
return await GetItem("FFL_GetSongs", parameters);
}

public async Task<bool> SaveItem(int songCode, int showCode, int showSongOrder)
Expand All @@ -52,7 +52,7 @@ public async Task<bool> SaveItem(int songCode, int showCode, int showSongOrder)
parameters.Add("@ShowCode", showCode, DbType.Int32);
parameters.Add("@ShowSongOrder", showSongOrder, DbType.Int32);

return await base.SaveItem("FFL_SaveShowSong", parameters);
return await SaveItem("FFL_SaveShowSong", parameters);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public class YearDataAccess : BaseDataAccess<Year>, IYearDataAccess
{
public YearDataAccess(IConfiguration configuration)
{
base.SetupConnectionString(configuration);
SetupConnectionString(configuration);
}

public async Task<List<Year>> GetList()
{
return await base.GetList("FFL_GetYearList");
return await GetList("FFL_GetYearList");
}

}
Expand Down
8 changes: 1 addition & 7 deletions src/SamSmithNZ.Service/Models/FooFighters/AverageSetlist.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SamSmithNZ.Service.Models.FooFighters
namespace SamSmithNZ.Service.Models.FooFighters
{
public class AverageSetlist
{
Expand Down
16 changes: 8 additions & 8 deletions src/SamSmithNZ.Tests/FooFighters/AlbumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public async Task AlbumsExistTest()
List<Album> items = await controller.GetAlbums();

//assert
Assert.IsTrue(items != null);
Assert.IsTrue(items.Count > 0); //There is more than one
Assert.IsTrue(items[0].AlbumCode > 0); //The first item has an id
Assert.IsTrue(items[0].AlbumName.Length > 0); //The first item has an name
Assert.IsNotNull(items);
Assert.IsNotEmpty(items); //There is more than one
Assert.IsGreaterThan(0, items[0].AlbumCode); //The first item has an id
Assert.IsGreaterThan(0, items[0].AlbumName.Length); //The first item has an name
}

[TestMethod()]
Expand All @@ -41,10 +41,10 @@ public async Task AlbumsGetFooFightersTest()
Album item = await controller.GetAlbum(albumKey);

//assert
Assert.IsTrue(item != null);
Assert.IsTrue(item.AlbumImage == "220px-FooFighters-FooFighters.jpg");
Assert.IsTrue(item.AlbumCode == 1);
Assert.IsTrue(item.AlbumName == "Foo Fighters");
Assert.IsNotNull(item);
Assert.AreEqual("220px-FooFighters-FooFighters.jpg", item.AlbumImage);
Assert.AreEqual(1, item.AlbumCode);
Assert.AreEqual("Foo Fighters", item.AlbumName);
Assert.IsTrue(item.AlbumReleaseDate >= DateTime.MinValue);
}

Expand Down
20 changes: 10 additions & 10 deletions src/SamSmithNZ.Tests/FooFighters/AverageSongTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public async Task AverageSetlistExistTest()
List<AverageSetlist> items = await controller.GetAverageSetlist(yearCode, minimumSongCount, showAllSongs);

//assert
Assert.IsTrue(items != null);
Assert.IsTrue(items.Count > 0);
Assert.IsNotNull(items);
Assert.IsNotEmpty(items);
}

[TestMethod()]
Expand All @@ -43,14 +43,14 @@ public async Task AverageSetlist2015Test()
List<AverageSetlist> items = await controller.GetAverageSetlist(yearCode, minimumSongCount, showAllSongs);

//assert
Assert.IsTrue(items != null);
Assert.IsTrue(items.Count > 0);
Assert.IsTrue(items[0].SongCode > 0);
Assert.IsTrue(items[0].SongName != "");
Assert.IsTrue(items[0].AvgShowSongOrder > 0);
Assert.IsTrue(items[0].SongCount > 0);
Assert.IsTrue(items[0].SongRank > 0);
Assert.IsTrue(items[0].YearCode > 0);
Assert.IsNotNull(items);
Assert.IsNotEmpty(items);
Assert.IsGreaterThan(0, items[0].SongCode);
Assert.AreNotEqual("", items[0].SongName);
Assert.IsGreaterThan(0, items[0].AvgShowSongOrder);
Assert.IsGreaterThan(0, items[0].SongCount);
Assert.IsGreaterThan(0, items[0].SongRank);
Assert.IsGreaterThan(0, items[0].YearCode);
}

}
Expand Down
40 changes: 20 additions & 20 deletions src/SamSmithNZ.Tests/FooFighters/ShowTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task ShowsExistForSongTest()
List<Show> items = await controller.GetShowsBySong(songKey);

//assert
Assert.IsTrue(items != null);
Assert.IsNotNull(items);
Assert.IsTrue(items.Count > 0);
}

Expand All @@ -42,18 +42,18 @@ public async Task ShowsForSongTest()
List<Show> items = await controller.GetShowsBySong(songKey);

//assert
Assert.IsTrue(items != null);
Assert.IsNotNull(items);
Assert.IsTrue(items.Count > 0);
Assert.IsTrue(items[0].Notes != "");
Assert.AreNotEqual("", items[0].Notes);
Assert.IsTrue(items[0].NumberOfSongsPlayed >= 0);
Assert.IsTrue(items[0].ShowCity == "Portland, OR");
Assert.IsTrue(items[0].ShowCountry == null);
Assert.AreEqual("Portland, OR", items[0].ShowCity);
Assert.IsNull(items[0].ShowCountry);
Assert.IsTrue(items[0].ShowDate >= DateTime.MinValue);
Assert.IsTrue(items[0].ShowCode == 3);
Assert.IsTrue(items[0].ShowLocation != "");
Assert.AreEqual(3, items[0].ShowCode);
Assert.AreNotEqual("", items[0].ShowLocation);
Assert.IsTrue(items[0].LastUpdated > DateTime.MinValue);
Assert.IsTrue(items[0].FFLCode == 0);
Assert.IsTrue(items[0].FFLURL == null);
Assert.AreEqual(0, items[0].FFLCode);
Assert.IsNull(items[0].FFLURL);
}

[TestMethod()]
Expand All @@ -67,7 +67,7 @@ public async Task ShowsExistForYearTest()
List<Show> items = await controller.GetShowsByYear(yearCode);

//assert
Assert.IsTrue(items != null);
Assert.IsNotNull(items);
Assert.IsTrue(items.Count > 0);
}

Expand All @@ -82,13 +82,13 @@ public async Task ShowsForYearTest()
List<Show> items = await controller.GetShowsByYear(yearCode);

//assert
Assert.IsTrue(items != null);
Assert.IsNotNull(items);
Assert.IsTrue(items.Count > 0);
Assert.IsTrue(items[2].NumberOfSongsPlayed >= 0);
Assert.IsTrue(items[2].ShowCity == "Seattle, WA");
Assert.AreEqual("Seattle, WA", items[2].ShowCity);
Assert.IsTrue(items[2].ShowDate >= DateTime.MinValue);
Assert.IsTrue(items[2].ShowCode == 4);
Assert.IsTrue(items[2].ShowLocation != "");
Assert.AreEqual(4, items[2].ShowCode);
Assert.AreNotEqual("", items[2].ShowLocation);
}


Expand All @@ -103,19 +103,19 @@ public async Task Show3Test()
Show result = await controller.GetShow(showKey);

//assert
Assert.IsTrue(result != null);
Assert.IsNotNull(result);
//Assert.IsTrue(result.IsCancelledShow == false);
//Assert.IsTrue(result.IsPostponedShow == false);
//Assert.IsTrue(result.Notes != "");
//Assert.IsTrue(result.NumberOfRecordings >= 0);
Assert.IsTrue(result.NumberOfSongsPlayed >= 0);
Assert.IsGreaterThanOrEqualTo(0, result.NumberOfSongsPlayed);
//Assert.IsTrue(result.NumberOfUnconfirmedRecordings >= 0);
//Assert.IsTrue(result.OtherPerformers != "");
Assert.IsTrue(result.ShowCity == "Portland, OR");
Assert.AreEqual("Portland, OR", result.ShowCity);
//Assert.IsTrue(result.ShowCountry == "United States");
Assert.IsTrue(result.ShowDate >= DateTime.MinValue);
Assert.IsTrue(result.ShowCode == 3);
Assert.IsTrue(result.ShowLocation != "");
Assert.AreEqual(3, result.ShowCode);
Assert.AreNotEqual("", result.ShowLocation);
}

[TestMethod()]
Expand All @@ -129,7 +129,7 @@ public async Task Show4Test()
Show result = await controller.GetShow(showKey);

//assert
Assert.IsTrue(result == null);
Assert.IsNull(result);
////Assert.IsTrue(result.IsCancelledShow == false);
////Assert.IsTrue(result.IsPostponedShow == false);
////Assert.IsTrue(result.Notes != "");
Expand Down
Loading
Loading