From 3f86c10c44fe8d35f121c591fd0142b514214d8c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 12 Feb 2018 17:37:42 -0800 Subject: [PATCH] Fix broken profile test --- .../Profiles/ProfileServiceFixture.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core.Test/Profiles/ProfileServiceFixture.cs b/src/NzbDrone.Core.Test/Profiles/ProfileServiceFixture.cs index 4f799fa7d..e621801e8 100644 --- a/src/NzbDrone.Core.Test/Profiles/ProfileServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Profiles/ProfileServiceFixture.cs @@ -41,15 +41,20 @@ namespace NzbDrone.Core.Test.Profiles [Test] public void should_not_be_able_to_delete_profile_if_assigned_to_series() { + var profile = Builder.CreateNew() + .With(p => p.Id = 2) + .Build(); + var seriesList = Builder.CreateListOfSize(3) .Random(1) - .With(c => c.ProfileId = 2) + .With(c => c.ProfileId = profile.Id) .Build().ToList(); Mocker.GetMock().Setup(c => c.GetAllSeries()).Returns(seriesList); + Mocker.GetMock().Setup(c => c.Get(profile.Id)).Returns(profile); - Assert.Throws(() => Subject.Delete(2)); + Assert.Throws(() => Subject.Delete(profile.Id)); Mocker.GetMock().Verify(c => c.Delete(It.IsAny()), Times.Never()); @@ -72,4 +77,4 @@ namespace NzbDrone.Core.Test.Profiles Mocker.GetMock().Verify(c => c.Delete(1), Times.Once()); } } -} \ No newline at end of file +}