Added basic unit tests for all controllers
This commit is contained in:
@ -3,7 +3,9 @@ using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using Aurora.Proto.PartyV2;
|
||||
using Aurora.Services.Library;
|
||||
using Aurora.Services.Settings;
|
||||
using Aurora.Models.Media;
|
||||
using Aurora.Services.Server.EventManager;
|
||||
using Autofac;
|
||||
|
||||
namespace Aurora.Services.Server.Controllers
|
||||
@ -11,11 +13,13 @@ namespace Aurora.Services.Server.Controllers
|
||||
public partial class RemotePartyController : RemotePartyService.RemotePartyServiceBase
|
||||
{
|
||||
private ILibraryService _libraryService;
|
||||
private ISettingsService _settingsService;
|
||||
private IEventManager _eventManager;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for partial class
|
||||
/// </summary>
|
||||
public RemotePartyController(string partyName, string description, ILibraryService libraryService)
|
||||
public RemotePartyController(string partyName, string description, ILibraryService libraryService, ISettingsService settingsService, IEventManager eventManager)
|
||||
{
|
||||
this._startDateTime = DateTime.UtcNow;
|
||||
this._displayName = partyName;
|
||||
@ -24,10 +28,11 @@ namespace Aurora.Services.Server.Controllers
|
||||
this._mediaList = new SortedList<string, Media>();
|
||||
|
||||
_libraryService = libraryService;
|
||||
this._settingsService = settingsService;
|
||||
|
||||
string userName = "testUser";
|
||||
string userName = _settingsService.Username;
|
||||
|
||||
this._eventManager = new EventManager.EventManager();
|
||||
this._eventManager = eventManager;
|
||||
|
||||
this._hostMember = new Member()
|
||||
{
|
||||
@ -54,7 +59,7 @@ namespace Aurora.Services.Server.Controllers
|
||||
metadata = media.Metadata as AudioMetadata;
|
||||
|
||||
Media data = new Media();
|
||||
data.Name = media.Id;
|
||||
data.Name = string.Format("{0}/{1}", partyName, media.Id);
|
||||
if (metadata.Title != null)
|
||||
{
|
||||
data.Title = metadata.Title;
|
||||
|
@ -15,8 +15,6 @@ namespace Aurora.Services.Server.Controllers
|
||||
private Member _hostMember;
|
||||
private DateTime _startDateTime;
|
||||
|
||||
private EventManager.EventManager _eventManager;
|
||||
|
||||
public override Task<Party> GetParty(Proto.General.Empty request, Grpc.Core.ServerCallContext context)
|
||||
{
|
||||
Party party = new Party()
|
||||
|
Reference in New Issue
Block a user