mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
ReSharper code cleanup
This commit is contained in:
parent
8cade435d1
commit
e896af5cd0
138 changed files with 2368 additions and 2218 deletions
|
@ -1,12 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using AutoMoq;
|
||||
using Gallio.Framework;
|
||||
using AutoMoq;
|
||||
using MbUnit.Framework;
|
||||
using MbUnit.Framework.ContractVerifiers;
|
||||
using Moq;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
using SubSonic.Repository;
|
||||
|
@ -24,13 +18,13 @@ namespace NzbDrone.Core.Test
|
|||
const string value = "MY_VALUE";
|
||||
|
||||
//Arrange
|
||||
var config = new Config { Key = key, Value = value };
|
||||
var config = new Config {Key = key, Value = value};
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
mocker.GetMock<IRepository>()
|
||||
.Setup(r => r.Single<Config>(key))
|
||||
.Returns(config);
|
||||
.Setup(r => r.Single<Config>(key))
|
||||
.Returns(config);
|
||||
|
||||
//Act
|
||||
mocker.Resolve<ConfigProvider>().SetValue(key, value);
|
||||
|
@ -50,9 +44,9 @@ namespace NzbDrone.Core.Test
|
|||
var mocker = new AutoMoqer();
|
||||
|
||||
mocker.GetMock<IRepository>()
|
||||
.Setup(r => r.Single<Config>(It.IsAny<string>()))
|
||||
.Returns<Config>(null)
|
||||
.Verifiable();
|
||||
.Setup(r => r.Single<Config>(It.IsAny<string>()))
|
||||
.Returns<Config>(null)
|
||||
.Verifiable();
|
||||
|
||||
//Act
|
||||
mocker.Resolve<ConfigProvider>().SetValue(key, value);
|
||||
|
@ -60,7 +54,8 @@ namespace NzbDrone.Core.Test
|
|||
//Assert
|
||||
mocker.GetMock<IRepository>().Verify();
|
||||
mocker.GetMock<IRepository>().Verify(r => r.Update(It.IsAny<Config>()), Times.Never());
|
||||
mocker.GetMock<IRepository>().Verify(r => r.Add(It.Is<Config>(c => c.Key == key && c.Value == value)), Times.Once());
|
||||
mocker.GetMock<IRepository>().Verify(r => r.Add(It.Is<Config>(c => c.Key == key && c.Value == value)),
|
||||
Times.Once());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue