mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
More bugfixes, tests.
This commit is contained in:
parent
b456c5c4d2
commit
be651660a4
9 changed files with 17 additions and 8 deletions
39
NzbDrone.App.Test/MonitoringProviderTest.cs
Normal file
39
NzbDrone.App.Test/MonitoringProviderTest.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AutoMoq;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Providers;
|
||||
|
||||
namespace NzbDrone.App.Test
|
||||
{
|
||||
[TestFixture]
|
||||
public class MonitoringProviderTest
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void Ensure_priority_doesnt_fail_on_invalid_iis_proccess_id()
|
||||
{
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
var processMock = mocker.GetMock<ProcessProvider>();
|
||||
processMock.Setup(c => c.GetCurrentProcess())
|
||||
.Returns(Builder<ProcessInfo>.CreateNew().With(c => c.Priority == ProcessPriorityClass.Normal).Build());
|
||||
|
||||
processMock.Setup(c => c.GetProcessById(It.IsAny<int>())).Returns((ProcessInfo)null);
|
||||
|
||||
var subject = mocker.Resolve<MonitoringProvider>();
|
||||
|
||||
|
||||
//Act
|
||||
subject.EnsurePriority(null, null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue