mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Remove trailing whitespace
This commit is contained in:
parent
8d27111f7b
commit
d4fa9b7345
@ -5,7 +5,7 @@
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyCompany("Microsoft Open Technologies, Inc.")]
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
||||
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
//
|
||||
// To add a suppression to this file, right-click the message in the
|
||||
// Code Analysis results, point to "Suppress Message", and click
|
||||
// To add a suppression to this file, right-click the message in the
|
||||
// Code Analysis results, point to "Suppress Message", and click
|
||||
// "In Suppression File".
|
||||
// You do not need to add suppressions to this file manually.
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
<Project>
|
||||
<!-- Common to all Radarr Projects -->
|
||||
<PropertyGroup>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<CodeAnalysisRuleSet>$(SolutionDir)Stylecop.ruleset</CodeAnalysisRuleSet>
|
||||
<!-- <TreatWarningsAsErrors>true</TreatWarningsAsErrors> -->
|
||||
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
@ -92,6 +93,16 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Set up stylecop -->
|
||||
<ItemGroup Condition="'$(RadarrProject)'=='true' and '$(RadarrOutputType)'!='Test'">
|
||||
<!-- StyleCop analysis -->
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<AdditionalFiles Include="$(SolutionDir)stylecop.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Set runtime identifier to local system type if not specified
|
||||
-->
|
||||
|
@ -27,14 +27,14 @@ namespace Marr.Data
|
||||
/// </summary>
|
||||
internal static class DataHelper
|
||||
{
|
||||
public static bool HasColumn(this IDataReader dr, string columnName)
|
||||
{
|
||||
for (int i=0; i < dr.FieldCount; i++)
|
||||
{
|
||||
if (dr.GetName(i).Equals(columnName, StringComparison.InvariantCultureIgnoreCase))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
public static bool HasColumn(this IDataReader dr, string columnName)
|
||||
{
|
||||
for (int i=0; i < dr.FieldCount; i++)
|
||||
{
|
||||
if (dr.GetName(i).Equals(columnName, StringComparison.InvariantCultureIgnoreCase))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string ParameterPrefix(this IDbCommand command)
|
||||
@ -42,7 +42,7 @@ public static string ParameterPrefix(this IDbCommand command)
|
||||
string commandType = command.GetType().Name.ToLower();
|
||||
return commandType.Contains("oracle") ? ":" : "@";
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the mapped name, or the member name.
|
||||
/// </summary>
|
||||
|
@ -131,8 +131,8 @@ public IDbDataParameter AddParameter(IDbDataParameter parameter)
|
||||
#region - SP / SQL Mode -
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value that determines whether the DataMapper will
|
||||
/// use a stored procedure or a sql text command to access
|
||||
/// Gets or sets a value that determines whether the DataMapper will
|
||||
/// use a stored procedure or a sql text command to access
|
||||
/// the database. The default is stored procedure.
|
||||
/// </summary>
|
||||
public SqlModes SqlMode { get; set; }
|
||||
@ -617,7 +617,7 @@ internal ICollection<T> QueryToGraph<T>(string sql, EntityGraph graph, List<Memb
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
// The entire EntityGraph is traversed for each record,
|
||||
// The entire EntityGraph is traversed for each record,
|
||||
// and multiple entities are created from each view record.
|
||||
foreach (EntityGraph lvl in graph)
|
||||
{
|
||||
|
@ -238,14 +238,14 @@ public bool IsNewGroup(DbDataReader reader)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the GroupingKeys for this entity.
|
||||
/// Gets the GroupingKeys for this entity.
|
||||
/// GroupingKeys determine when to create and add a new entity to the graph.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A simple entity with no relationships will return only its PrimaryKey columns.
|
||||
/// A parent entity with one-to-one child relationships will include its own PrimaryKeys,
|
||||
/// and it will recursively traverse all Children with one-to-one relationships and add their PrimaryKeys.
|
||||
/// A child entity that has a one-to-one relationship with its parent will use the same
|
||||
/// A child entity that has a one-to-one relationship with its parent will use the same
|
||||
/// GroupingKeys already defined by its parent.
|
||||
/// </remarks>
|
||||
public GroupingKeyCollection GroupingKeyColumns
|
||||
|
@ -32,11 +32,11 @@ public interface IDataMapper : IDisposable
|
||||
DbCommand Command { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value that determines whether the DataMapper will
|
||||
/// use a stored procedure or a sql text command to access
|
||||
/// Gets or sets a value that determines whether the DataMapper will
|
||||
/// use a stored procedure or a sql text command to access
|
||||
/// the database. The default is stored procedure.
|
||||
/// </summary>
|
||||
SqlModes SqlMode { get; set; }
|
||||
SqlModes SqlMode { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -181,10 +181,10 @@ public RelationshipCollection GetRelationships(Type type)
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the reflection strategy that the DataMapper will use to load entities.
|
||||
/// By default the CachedReflector will be used, which provides a performance increase over the SimpleReflector.
|
||||
/// By default the CachedReflector will be used, which provides a performance increase over the SimpleReflector.
|
||||
/// However, the SimpleReflector can be used in Medium Trust enviroments.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public IReflectionStrategy ReflectionStrategy { get; set; }
|
||||
|
||||
#endregion
|
||||
@ -236,7 +236,7 @@ internal IConverter GetConverter(Type dataType)
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IDBTypeBuilder that is responsible for converting parameter DbTypes based on the parameter value.
|
||||
/// Defaults to use the DbTypeBuilder.
|
||||
/// Defaults to use the DbTypeBuilder.
|
||||
/// You can replace this with a more specific builder if you want more control over the way the parameter types are set.
|
||||
/// </summary>
|
||||
public IDbTypeBuilder DbTypeBuilder
|
||||
|
@ -198,7 +198,7 @@ public FluentMappings.MappingsFluentEntity<TNewEntity> Entity<TNewEntity>()
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to add a ColumnMap for the given field name.
|
||||
/// Tries to add a ColumnMap for the given field name.
|
||||
/// Throws and exception if field cannot be found.
|
||||
/// </summary>
|
||||
private void TryAddColumnMapForField(string fieldName)
|
||||
|
@ -99,7 +99,7 @@ public ColumnMapCollection PrimaryKeys
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses and orders the parameters from the query text.
|
||||
/// Parses and orders the parameters from the query text.
|
||||
/// Filters the list of mapped columns to match the parameters found in the sql query.
|
||||
/// All parameters starting with the '@' or ':' symbol are matched and returned.
|
||||
/// </summary>
|
||||
@ -139,7 +139,7 @@ public ColumnMapCollection OrderParameters(DbCommand command)
|
||||
|
||||
/// <summary>
|
||||
/// Set's each column's altname as the given prefix + the column name.
|
||||
/// Ex:
|
||||
/// Ex:
|
||||
/// Original column name: "ID"
|
||||
/// Passed in prefix: "PRODUCT_"
|
||||
/// Generated AltName: "PRODUCT_ID"
|
||||
@ -154,7 +154,7 @@ public ColumnMapCollection PrefixAltNames(string prefix)
|
||||
|
||||
/// <summary>
|
||||
/// Set's each column's altname as the column name + the given prefix.
|
||||
/// Ex:
|
||||
/// Ex:
|
||||
/// Original column name: "ID"
|
||||
/// Passed in suffix: "_PRODUCT"
|
||||
/// Generated AltName: "ID_PRODUCT"
|
||||
|
@ -19,7 +19,7 @@ public FluentMappings()
|
||||
public FluentMappings(bool publicOnly)
|
||||
{
|
||||
_publicOnly = publicOnly;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public MappingsFluentEntity<TEntity> Entity<TEntity>()
|
||||
@ -77,7 +77,7 @@ public ColumnMapBuilder<TEntity> AutoMapAllProperties()
|
||||
|
||||
/// <summary>
|
||||
/// Creates column mappings for the given type.
|
||||
/// Maps all properties that are simple types (int, string, DateTime, etc).
|
||||
/// Maps all properties that are simple types (int, string, DateTime, etc).
|
||||
/// ICollection properties are not included.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type that is being built.</typeparam>
|
||||
|
@ -28,5 +28,5 @@ public interface IColumnInfo
|
||||
ParameterDirection ParamDirection { get; set; }
|
||||
string TryGetAltName();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public ColumnMapBuilder<T> BuildColumns<T>()
|
||||
|
||||
/// <summary>
|
||||
/// Creates column mappings for the given type.
|
||||
/// Maps all properties that are simple types (int, string, DateTime, etc).
|
||||
/// Maps all properties that are simple types (int, string, DateTime, etc).
|
||||
/// ICollection properties are not included.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type that is being built.</typeparam>
|
||||
@ -49,7 +49,7 @@ public ColumnMapBuilder<T> BuildColumnsFromSimpleTypes<T>()
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates column mappings for the given type.
|
||||
/// Creates column mappings for the given type.
|
||||
/// Maps properties that are included in the include list.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type that is being built.</typeparam>
|
||||
@ -71,7 +71,7 @@ public ColumnMapBuilder<T> BuildColumns<T>(params string[] propertiesToInclude)
|
||||
/// <returns><see cref="ColumnMapCollection"/></returns>
|
||||
public ColumnMapBuilder<T> BuildColumnsExcept<T>(params string[] propertiesToExclude)
|
||||
{
|
||||
return BuildColumns<T>(m =>
|
||||
return BuildColumns<T>(m =>
|
||||
m.MemberType == MemberTypes.Property &&
|
||||
!propertiesToExclude.Contains(m.Name));
|
||||
}
|
||||
@ -105,7 +105,7 @@ public ColumnMapBuilder<T> Columns<T>()
|
||||
MapRepository.Instance.Columns[entityType] = columns;
|
||||
return new ColumnMapBuilder<T>(null, columns);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region - Relationships -
|
||||
@ -118,8 +118,8 @@ public ColumnMapBuilder<T> Columns<T>()
|
||||
/// <returns><see cref="RelationshipBuilder"/></returns>
|
||||
public RelationshipBuilder<T> BuildRelationships<T>()
|
||||
{
|
||||
return BuildRelationships<T>(m =>
|
||||
m.MemberType == MemberTypes.Property &&
|
||||
return BuildRelationships<T>(m =>
|
||||
m.MemberType == MemberTypes.Property &&
|
||||
typeof(ICollection).IsAssignableFrom((m as PropertyInfo).PropertyType));
|
||||
}
|
||||
|
||||
@ -132,10 +132,10 @@ public RelationshipBuilder<T> BuildRelationships<T>()
|
||||
/// <returns><see cref="RelationshipBuilder"/></returns>
|
||||
public RelationshipBuilder<T> BuildRelationships<T>(params string[] propertiesToInclude)
|
||||
{
|
||||
Func<MemberInfo, bool> predicate = m =>
|
||||
Func<MemberInfo, bool> predicate = m =>
|
||||
(
|
||||
// ICollection properties
|
||||
m.MemberType == MemberTypes.Property &&
|
||||
m.MemberType == MemberTypes.Property &&
|
||||
typeof(ICollection).IsAssignableFrom((m as PropertyInfo).PropertyType) &&
|
||||
propertiesToInclude.Contains(m.Name)
|
||||
) || ( // Single entity properties
|
||||
@ -143,7 +143,7 @@ public RelationshipBuilder<T> BuildRelationships<T>(params string[] propertiesTo
|
||||
!typeof(ICollection).IsAssignableFrom((m as PropertyInfo).PropertyType) &&
|
||||
propertiesToInclude.Contains(m.Name)
|
||||
);
|
||||
|
||||
|
||||
return BuildRelationships<T>(predicate);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ public RelationshipBuilder<T> Relationships<T>()
|
||||
MapRepository.Instance.Relationships[entityType] = relationships;
|
||||
return new RelationshipBuilder<T>(null, relationships);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region - Tables -
|
||||
|
@ -135,7 +135,7 @@ public FluentMappings.MappingsFluentEntity<TNewEntity> Entity<TNewEntity>()
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to add a Relationship for the given field name.
|
||||
/// Tries to add a Relationship for the given field name.
|
||||
/// Throws and exception if field cannot be found.
|
||||
/// </summary>
|
||||
private void TryAddRelationshipForField(string fieldName)
|
||||
|
@ -23,9 +23,9 @@ public ConventionMapStrategy(bool publicOnly)
|
||||
}
|
||||
|
||||
public Func<MemberInfo, bool> ColumnPredicate;
|
||||
public Func<MemberInfo, bool> RelationshipPredicate;
|
||||
public Func<MemberInfo, bool> RelationshipPredicate;
|
||||
|
||||
|
||||
|
||||
|
||||
protected override void CreateColumnMap(Type entityType, MemberInfo member, ColumnAttribute columnAtt, ColumnMapCollection columnMaps)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ You should have received a copy of the GNU Lesser General Public
|
||||
namespace Marr.Data.Mapping.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Maps all public properties to DB columns.
|
||||
/// Maps all public properties to DB columns.
|
||||
/// </summary>
|
||||
public class PropertyMapStrategy : AttributeMapStrategy
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ public ColumnMapCollection MapColumns(Type entityType)
|
||||
ColumnAttribute columnAtt = GetColumnAttribute(member);
|
||||
CreateColumnMap(entityType, member, columnAtt, columnMaps);
|
||||
}
|
||||
|
||||
|
||||
return columnMaps;
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ protected RelationshipAttribute GetRelationshipAttribute(MemberInfo member)
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Inspect a member and optionally add a ColumnMap.
|
||||
/// </summary>
|
||||
|
@ -19,7 +19,7 @@ You should have received a copy of the GNU Lesser General Public
|
||||
namespace Marr.Data.Parameters
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts from a .NET datatype to the appropriate DB type enum,
|
||||
/// Converts from a .NET datatype to the appropriate DB type enum,
|
||||
/// and then adds the value to the appropriate property on the parameter.
|
||||
/// </summary>
|
||||
public interface IDbTypeBuilder
|
||||
|
@ -37,7 +37,7 @@ public ParameterChainMethods(DbCommand command, string parameterName, object val
|
||||
Parameter.ParameterName = parameterName;
|
||||
|
||||
// Convert null to DBNull.Value
|
||||
if (value == null)
|
||||
if (value == null)
|
||||
value = DBNull.Value;
|
||||
|
||||
Type valueType = value.GetType();
|
||||
@ -59,9 +59,9 @@ public ParameterChainMethods(DbCommand command, string parameterName, object val
|
||||
else
|
||||
{
|
||||
Parameter.Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// Determine the correct DbType based on the passed in value type
|
||||
//IDbTypeBuilder typeBuilder = MapRepository.Instance.DbTypeBuilder;
|
||||
@ -122,7 +122,7 @@ public ParameterChainMethods Scale(byte scale)
|
||||
Parameter.Scale = scale;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ParameterChainMethods Name(string name)
|
||||
{
|
||||
Parameter.ParameterName = name;
|
||||
|
@ -21,7 +21,7 @@ public DeleteQuery(Dialect dialect, Table targetTable, string whereClause)
|
||||
public string Generate()
|
||||
{
|
||||
return string.Format("DELETE FROM {0} {1} ",
|
||||
Dialect.CreateToken(TargetTable.Name),
|
||||
Dialect.CreateToken(TargetTable.Name),
|
||||
WhereClause);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
namespace Marr.Data.QGen
|
||||
{
|
||||
///<summary>
|
||||
/// Expression visitor
|
||||
/// Expression visitor
|
||||
///</summary>
|
||||
public class ExpressionVisitor
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ public virtual object Execute()
|
||||
_db.CloseConnection();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (_generateQuery)
|
||||
{
|
||||
// Return to previous sql mode
|
||||
|
@ -6,7 +6,7 @@
|
||||
namespace Marr.Data.QGen
|
||||
{
|
||||
/// <summary>
|
||||
/// This class overrides the WhereBuilder which utilizes the ExpressionVisitor base class,
|
||||
/// This class overrides the WhereBuilder which utilizes the ExpressionVisitor base class,
|
||||
/// and it is responsible for translating the lambda expression into a "JOIN ON" clause.
|
||||
/// It populates the protected string builder, which outputs the "JOIN ON" clause when the ToString method is called.
|
||||
/// </summary>
|
||||
|
@ -27,7 +27,7 @@ public PagingQueryDecorator(SelectQuery innerQuery, int skip, int take)
|
||||
public string Generate()
|
||||
{
|
||||
// Decide which type of paging query to create
|
||||
|
||||
|
||||
if (_innerQuery.IsView || _innerQuery.IsJoin)
|
||||
{
|
||||
return ComplexPaging();
|
||||
@ -56,7 +56,7 @@ private string SimplePaging()
|
||||
|
||||
return sql.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generates a query that pages a view or joined inner query.
|
||||
/// </summary>
|
||||
@ -165,7 +165,7 @@ private void BuildRowNumberColumn(StringBuilder sql)
|
||||
{
|
||||
orderBy = orderBy.Replace(string.Format("[{0}].", t.Alias), "");
|
||||
}
|
||||
|
||||
|
||||
sql.AppendFormat(", ROW_NUMBER() OVER ({0}) As RowNumber ", orderBy);
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ public virtual QueryBuilder<T> Graph(params Expression<Func<T, object>>[] childr
|
||||
_isGraph = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public virtual QueryBuilder<T> Page(int pageNumber, int pageSize)
|
||||
{
|
||||
_enablePaging = true;
|
||||
@ -198,7 +198,7 @@ public virtual QueryBuilder<T> Page(int pageNumber, int pageSize)
|
||||
_take = pageSize;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
private string[] ParseChildrenToLoad(Expression<Func<T, object>>[] childrenToLoad)
|
||||
{
|
||||
List<string> entitiesToLoad = new List<string>();
|
||||
@ -208,7 +208,7 @@ private string[] ParseChildrenToLoad(Expression<Func<T, object>>[] childrenToLoa
|
||||
{
|
||||
MemberInfo member = (exp.Body as MemberExpression).Member;
|
||||
entitiesToLoad.Add(member.Name);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return entitiesToLoad.ToArray();
|
||||
|
@ -16,7 +16,7 @@ internal class QueryFactory
|
||||
private const string DB_OracleDataAccessClient = "Oracle.DataAccess.Client.OracleClientFactory";
|
||||
private const string DB_FireBirdClient = "FirebirdSql.Data.FirebirdClient.FirebirdClientFactory";
|
||||
private const string DB_SQLiteClient = "System.Data.SQLite.SQLiteFactory";
|
||||
|
||||
|
||||
public static IQuery CreateUpdateQuery(ColumnMapCollection columns, IDataMapper dataMapper, string target, string whereClause)
|
||||
{
|
||||
Dialect dialect = CreateDialect(dataMapper);
|
||||
|
@ -10,7 +10,7 @@ public RowCountQueryDecorator(SelectQuery innerQuery)
|
||||
{
|
||||
_innerQuery = innerQuery;
|
||||
}
|
||||
|
||||
|
||||
public string Generate()
|
||||
{
|
||||
// Decide which type of paging query to create
|
||||
@ -108,12 +108,12 @@ private Table GetBaseTable()
|
||||
}
|
||||
|
||||
/*
|
||||
WITH GroupCTE AS
|
||||
WITH GroupCTE AS
|
||||
(
|
||||
SELECT [t0].[ID],[t0].[OrderName],[t1].[ID] AS OrderItemID,[t1].[OrderID],[t1].[ItemDescription],[t1].[Price],
|
||||
ROW_NUMBER() OVER (PARTITION BY [t0].[ID] ORDER BY [t0].[OrderName]) As GroupRow
|
||||
FROM [Order] [t0]
|
||||
LEFT JOIN [OrderItem] [t1] ON (([t0].[ID] = [t1].[OrderID]))
|
||||
SELECT [t0].[ID],[t0].[OrderName],[t1].[ID] AS OrderItemID,[t1].[OrderID],[t1].[ItemDescription],[t1].[Price],
|
||||
ROW_NUMBER() OVER (PARTITION BY [t0].[ID] ORDER BY [t0].[OrderName]) As GroupRow
|
||||
FROM [Order] [t0]
|
||||
LEFT JOIN [OrderItem] [t1] ON (([t0].[ID] = [t1].[OrderID]))
|
||||
--WHERE (([t0].[OrderName] = @P0))
|
||||
)
|
||||
SELECT * FROM GroupCTE
|
||||
|
@ -131,7 +131,7 @@ public void BuildOrderClause(StringBuilder sql)
|
||||
{
|
||||
sql.Append(OrderBy.ToString());
|
||||
}
|
||||
|
||||
|
||||
public void BuildGroupBy(StringBuilder sql)
|
||||
{
|
||||
var baseTable = this.Tables.First();
|
||||
|
@ -85,7 +85,7 @@ internal SortBuilder<T> OrderByDescending(Type declaringType, string propertyNam
|
||||
_sortExpressions.Add(new SortColumn<T>(declaringType, propertyName, SortDirection.Desc));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public virtual SortBuilder<T> OrderBy(string orderByClause)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderByClause))
|
||||
|
@ -37,7 +37,7 @@ private MemberExpression GetMemberExpression(Expression exp)
|
||||
return me;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum SortDirection
|
||||
{
|
||||
Asc,
|
||||
|
@ -10,11 +10,11 @@ public SqliteRowCountQueryDecorator(SelectQuery innerQuery)
|
||||
{
|
||||
_innerQuery = innerQuery;
|
||||
}
|
||||
|
||||
|
||||
public string Generate()
|
||||
{
|
||||
StringBuilder sql = new StringBuilder();
|
||||
|
||||
|
||||
BuildSelectCountClause(sql);
|
||||
|
||||
if (_innerQuery.IsJoin)
|
||||
@ -29,7 +29,7 @@ public string Generate()
|
||||
|
||||
return sql.ToString();
|
||||
}
|
||||
|
||||
|
||||
_innerQuery.BuildFromClause(sql);
|
||||
_innerQuery.BuildJoinClauses(sql);
|
||||
_innerQuery.BuildWhereClause(sql);
|
||||
|
@ -155,7 +155,7 @@ public virtual int Execute()
|
||||
{
|
||||
_db.OpenConnection();
|
||||
rowsAffected = _db.Command.ExecuteNonQuery();
|
||||
_mappingHelper.SetOutputValues<T>(_entity, _mappings.OutputFields);
|
||||
_mappingHelper.SetOutputValues<T>(_entity, _mappings.OutputFields);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ public Table[] Tables
|
||||
{
|
||||
get { return _tables; }
|
||||
}
|
||||
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
|
@ -49,7 +49,7 @@ public WhereBuilder(DbCommand command, Dialect dialect, Expression filter, Table
|
||||
{
|
||||
_sb.AppendFormat("{0} ", PrefixText);
|
||||
base.Visit(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual string PrefixText
|
||||
@ -93,7 +93,7 @@ protected override Expression VisitMethodCall(MethodCallExpression expression)
|
||||
case "EndsWith":
|
||||
Write_EndsWith(expression);
|
||||
break;
|
||||
|
||||
|
||||
case "In":
|
||||
Write_In(expression);
|
||||
break;
|
||||
@ -148,14 +148,14 @@ protected override Expression VisitConstant(ConstantExpression expression)
|
||||
private object GetRightValue(Expression expression)
|
||||
{
|
||||
object rightValue = null;
|
||||
|
||||
|
||||
var simpleConstExp = expression as ConstantExpression;
|
||||
if (simpleConstExp == null) // Value is not directly passed in as a constant
|
||||
{
|
||||
MemberExpression memberExp = expression as MemberExpression;
|
||||
ConstantExpression constExp = null;
|
||||
|
||||
// Value may be nested in multiple levels of objects/properties, so traverse the MemberExpressions
|
||||
// Value may be nested in multiple levels of objects/properties, so traverse the MemberExpressions
|
||||
// until a ConstantExpression property value is found, and then unwind the stack to get the value.
|
||||
var memberNames = new Stack<string>();
|
||||
|
||||
@ -218,8 +218,8 @@ protected string GetFullyQualifiedColumnName(MemberInfo member, Type declaringTy
|
||||
|
||||
private string Decode(BinaryExpression expression)
|
||||
{
|
||||
bool isRightSideNullConstant = expression.Right.NodeType ==
|
||||
ExpressionType.Constant &&
|
||||
bool isRightSideNullConstant = expression.Right.NodeType ==
|
||||
ExpressionType.Constant &&
|
||||
((ConstantExpression)expression.Right).Value == null;
|
||||
|
||||
if (isRightSideNullConstant)
|
||||
@ -315,7 +315,7 @@ public override string ToString()
|
||||
}
|
||||
return _constantWhereClause;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal enum WhereAppendType
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public static object GetDefaultValue(Type fieldType)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the CLR data type of a MemberInfo.
|
||||
/// Gets the CLR data type of a MemberInfo.
|
||||
/// If the type is nullable, returns the underlying type.
|
||||
/// </summary>
|
||||
/// <param name="member"></param>
|
||||
|
@ -7,7 +7,7 @@ namespace Marr.Data
|
||||
/// <summary>
|
||||
/// The UnitOfWork class can be used to manage the lifetime of an IDataMapper, from creation to disposal.
|
||||
/// When used in a "using" statement, the UnitOfWork will create and dispose an IDataMapper.
|
||||
/// When the SharedContext property is used in a "using" statement,
|
||||
/// When the SharedContext property is used in a "using" statement,
|
||||
/// it will create a parent unit of work that will share a single IDataMapper with other units of work,
|
||||
/// and the IDataMapper will not be disposed until the shared context is disposed.
|
||||
/// If more than one shared context is created, the IDataMapper will be disposed when the outer most
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace Marr.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Works in conjunction with the UnitOfWork to create a new
|
||||
/// Works in conjunction with the UnitOfWork to create a new
|
||||
/// shared context that will preserve a single IDataMapper.
|
||||
/// </summary>
|
||||
public class UnitOfWorkSharedContext : IDisposable
|
||||
|
@ -59,7 +59,7 @@ public override int Encode(byte[] buffer, int offset)
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
internal override void DecodeInternal(RawReader reader)
|
||||
@ -133,7 +133,7 @@ public static BEncodedDictionary DecodeTorrent(RawReader reader)
|
||||
}
|
||||
else
|
||||
value = BEncodedValue.Decode(reader); // the value is a BEncoded value
|
||||
|
||||
|
||||
torrent.dictionary.Add(key, value);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public BEncodedList(IEnumerable<BEncodedValue> list)
|
||||
{
|
||||
if (list == null)
|
||||
throw new ArgumentNullException("list");
|
||||
|
||||
|
||||
this.list = new List<BEncodedValue>(list);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ public override int Encode(byte[] buffer, int offset)
|
||||
|
||||
int written = offset;
|
||||
buffer[written++] = (byte)'i';
|
||||
|
||||
|
||||
if (number < 0)
|
||||
{
|
||||
buffer[written++] = (byte)'-';
|
||||
@ -171,7 +171,7 @@ public int CompareTo(long other)
|
||||
|
||||
#region Overridden Methods
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
@ -185,7 +185,7 @@ public override bool Equals(object obj)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override int GetHashCode()
|
||||
@ -194,7 +194,7 @@ public override int GetHashCode()
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
|
@ -87,7 +87,7 @@ public static BEncodedValue Decode(byte[] buffer, int offset, int length, bool s
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Decode BEncoded data in the given stream
|
||||
/// Decode BEncoded data in the given stream
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream containing the BEncoded data</param>
|
||||
/// <returns>BEncodedValue containing the data that was in the stream</returns>
|
||||
@ -177,7 +177,7 @@ public static T Decode<T>(byte[] buffer, int offset, int length, bool strictDeco
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Decode BEncoded data in the given stream
|
||||
/// Decode BEncoded data in the given stream
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream containing the BEncoded data</param>
|
||||
/// <returns>BEncodedValue containing the data that was in the stream</returns>
|
||||
|
@ -61,7 +61,7 @@ public bool IsValid(byte[] hash, int hashIndex)
|
||||
throw new ArgumentException(string.Format("Hash must be {0} bytes in length", HashCodeLength), "hash");
|
||||
|
||||
if (hashIndex < 0 || hashIndex > this.count)
|
||||
throw new ArgumentOutOfRangeException("hashIndex", string.Format("hashIndex must be between 0 and {0}", this.count));
|
||||
throw new ArgumentOutOfRangeException("hashIndex", string.Format("hashIndex must be between 0 and {0}", this.count));
|
||||
|
||||
int start = hashIndex * HashCodeLength;
|
||||
for (int i = 0; i < HashCodeLength; i++)
|
||||
|
@ -100,7 +100,7 @@ public static InfoHash FromBase32(string infoHash)
|
||||
Check.InfoHash (infoHash);
|
||||
if (infoHash.Length != 32)
|
||||
throw new ArgumentException("Infohash must be a base32 encoded 32 character string");
|
||||
|
||||
|
||||
infoHash = infoHash.ToLower();
|
||||
int infohashOffset =0 ;
|
||||
byte[] hash = new byte[20];
|
||||
@ -126,7 +126,7 @@ public static InfoHash FromHex(string infoHash)
|
||||
Check.InfoHash (infoHash);
|
||||
if (infoHash.Length != 40)
|
||||
throw new ArgumentException("Infohash must be 40 characters long");
|
||||
|
||||
|
||||
byte[] hash = new byte[20];
|
||||
for (int i = 0; i < hash.Length; i++)
|
||||
hash[i] = byte.Parse(infoHash.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber);
|
||||
|
@ -26,7 +26,7 @@ public static long Accumulate<T>(IEnumerable<T> enumerable, Operation<T> action)
|
||||
|
||||
foreach (T t in enumerable)
|
||||
count += action(t);
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,8 @@ public IList<RawTrackerTier> AnnounceUrls
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This dictionary is specific for azureus client
|
||||
/// It can contain
|
||||
/// This dictionary is specific for azureus client
|
||||
/// It can contain
|
||||
/// dht_backup_enable (number)
|
||||
/// Content (dictionnary)
|
||||
/// Publisher
|
||||
@ -651,7 +651,7 @@ public static bool TryLoad(byte[] data, out Torrent torrent)
|
||||
public static bool TryLoad(Stream stream, out Torrent torrent)
|
||||
{
|
||||
Check.Stream(stream);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
torrent = Torrent.Load(stream);
|
||||
@ -676,7 +676,7 @@ public static bool TryLoad(Uri url, string location, out Torrent torrent)
|
||||
{
|
||||
Check.Url(url);
|
||||
Check.Location(location);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
torrent = Torrent.Load(url, location);
|
||||
|
@ -114,11 +114,11 @@ private void CreateEvent(Ical.Net.Calendar calendar, Movie movie, bool cinemasRe
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var occurrence = calendar.Create<CalendarEvent>();
|
||||
occurrence.Uid = "NzbDrone_movie_" + movie.Id + (cinemasRelease ? "_cinemas" : "_physical");
|
||||
occurrence.Status = movie.Status == MovieStatusType.Announced ? EventStatus.Tentative : EventStatus.Confirmed;
|
||||
|
||||
|
||||
occurrence.Start = new CalDateTime(date.Value);
|
||||
occurrence.End = occurrence.Start;
|
||||
occurrence.IsAllDay = true;
|
||||
|
@ -26,7 +26,7 @@ public static UiConfigResource ToResource(IConfigService model)
|
||||
{
|
||||
FirstDayOfWeek = model.FirstDayOfWeek,
|
||||
CalendarWeekColumnHeader = model.CalendarWeekColumnHeader,
|
||||
|
||||
|
||||
ShortDateFormat = model.ShortDateFormat,
|
||||
LongDateFormat = model.LongDateFormat,
|
||||
TimeFormat = model.TimeFormat,
|
||||
|
@ -12,7 +12,7 @@ public IndexerModule(IndexerFactory indexerFactory)
|
||||
protected override void MapToResource(IndexerResource resource, IndexerDefinition definition)
|
||||
{
|
||||
base.MapToResource(resource, definition);
|
||||
|
||||
|
||||
resource.EnableRss = definition.EnableRss;
|
||||
resource.EnableSearch = definition.EnableAutomaticSearch || definition.EnableInteractiveSearch;
|
||||
resource.SupportsRss = definition.SupportsRss;
|
||||
|
@ -23,7 +23,7 @@ public class ReleaseModule : ReleaseModuleBase
|
||||
private readonly IPrioritizeDownloadDecision _prioritizeDownloadDecision;
|
||||
private readonly IDownloadService _downloadService;
|
||||
private readonly Logger _logger;
|
||||
|
||||
|
||||
private readonly ICached<RemoteMovie> _remoteMovieCache;
|
||||
|
||||
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
||||
@ -46,7 +46,7 @@ public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
||||
|
||||
//PostValidator.RuleFor(s => s.DownloadAllowed).Equal(true);
|
||||
PostValidator.RuleFor(s => s.Guid).NotEmpty();
|
||||
|
||||
|
||||
_remoteMovieCache = cacheManager.GetCache<RemoteMovie>(GetType(), "remoteMovies");
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ protected override ReleaseResource MapDecision(DownloadDecision decision, int in
|
||||
{
|
||||
|
||||
_remoteMovieCache.Set(decision.RemoteMovie.Release.Guid, decision.RemoteMovie, TimeSpan.FromMinutes(30));
|
||||
|
||||
|
||||
return base.MapDecision(decision, initialWeight);
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ private List<LogFileResource> GetLogFilesResponse()
|
||||
{
|
||||
var file = files[i];
|
||||
var filename = Path.GetFileName(file);
|
||||
|
||||
|
||||
result.Add(new LogFileResource
|
||||
{
|
||||
Id = i + 1,
|
||||
@ -63,7 +63,7 @@ private object GetLogFileResponse(string filename)
|
||||
return new NotFoundResponse();
|
||||
|
||||
var data = _diskProvider.ReadAllText(filePath);
|
||||
|
||||
|
||||
return new TextResponse(data);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ public class AlternativeTitleResource : RestResource
|
||||
{
|
||||
public AlternativeTitleResource()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Todo: Sorters should be done completely on the client
|
||||
|
@ -6,7 +6,7 @@ public class AlternativeYearResource : RestResource
|
||||
{
|
||||
public AlternativeYearResource()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Todo: Sorters should be done completely on the client
|
||||
|
@ -18,7 +18,7 @@ public MovieResource()
|
||||
//Todo: Sorters should be done completely on the client
|
||||
//Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing?
|
||||
//Todo: We should get the entire Profile instead of ID and Name separately
|
||||
|
||||
|
||||
//View Only
|
||||
public string Title { get; set; }
|
||||
public List<AlternativeTitleResource> AlternativeTitles { get; set; }
|
||||
@ -96,9 +96,9 @@ public static MovieResource ToResource(this Core.Movies.Movie model)
|
||||
long size = model.MovieFile?.Size ?? 0;
|
||||
bool downloaded = model.MovieFile != null;
|
||||
MovieFileResource movieFile = model.MovieFile?.ToResource();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*if(model.MovieFile != null)
|
||||
{
|
||||
model.MovieFile.LazyLoad();
|
||||
@ -110,7 +110,7 @@ public static MovieResource ToResource(this Core.Movies.Movie model)
|
||||
downloaded = true;
|
||||
movieFile = model.MovieFile.Value.ToResource();
|
||||
}*/
|
||||
|
||||
|
||||
//model.AlternativeTitles.LazyLoad();
|
||||
|
||||
return new MovieResource
|
||||
@ -134,18 +134,18 @@ public static MovieResource ToResource(this Core.Movies.Movie model)
|
||||
//NextAiring
|
||||
//PreviousAiring
|
||||
Images = model.Images,
|
||||
|
||||
|
||||
Year = model.Year,
|
||||
SecondaryYear = model.SecondaryYear,
|
||||
SecondaryYearSourceId = model.SecondaryYearSourceId,
|
||||
|
||||
|
||||
Path = model.Path,
|
||||
ProfileId = model.ProfileId,
|
||||
PathState = model.PathState,
|
||||
|
||||
|
||||
Monitored = model.Monitored,
|
||||
MinimumAvailability = model.MinimumAvailability,
|
||||
|
||||
|
||||
IsAvailable = model.IsAvailable(),
|
||||
FolderName = model.FolderName(),
|
||||
|
||||
@ -205,7 +205,7 @@ public static Core.Movies.Movie ToModel(this MovieResource resource)
|
||||
|
||||
Monitored = resource.Monitored,
|
||||
MinimumAvailability = resource.MinimumAvailability,
|
||||
|
||||
|
||||
Runtime = resource.Runtime,
|
||||
LastInfoSync = resource.LastInfoSync,
|
||||
CleanTitle = resource.CleanTitle,
|
||||
|
@ -27,7 +27,7 @@ public ImportExclusionsResource GetById(int id)
|
||||
{
|
||||
return _exclusionService.GetById(id).ToResource();
|
||||
}
|
||||
|
||||
|
||||
public int AddExclusion(ImportExclusionsResource exclusionResource)
|
||||
{
|
||||
var model = exclusionResource.ToModel();
|
||||
|
@ -12,7 +12,7 @@ public NotificationModule(NotificationFactory notificationFactory)
|
||||
protected override void MapToResource(NotificationResource resource, NotificationDefinition definition)
|
||||
{
|
||||
base.MapToResource(resource, definition);
|
||||
|
||||
|
||||
resource.OnGrab = definition.OnGrab;
|
||||
resource.OnDownload = definition.OnDownload;
|
||||
resource.OnUpgrade = definition.OnUpgrade;
|
||||
|
@ -88,7 +88,7 @@ private object Import()
|
||||
{
|
||||
var resource = Request.Body.FromJson<QueueResource>();
|
||||
var trackedDownload = GetTrackedDownload(resource.Id);
|
||||
|
||||
|
||||
_completedDownloadService.Process(trackedDownload, true);
|
||||
|
||||
return resource;
|
||||
|
@ -10,9 +10,9 @@ namespace NzbDrone.Api.Wanted
|
||||
{
|
||||
class MovieMissingModule : MovieModuleWithSignalR
|
||||
{
|
||||
public MovieMissingModule(IMovieService movieService,
|
||||
IUpgradableSpecification qualityUpgradableSpecification,
|
||||
IBroadcastSignalRMessage signalRBroadcaster)
|
||||
public MovieMissingModule(IMovieService movieService,
|
||||
IUpgradableSpecification qualityUpgradableSpecification,
|
||||
IBroadcastSignalRMessage signalRBroadcaster)
|
||||
: base(movieService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/missing")
|
||||
{
|
||||
GetResourcePaged = GetMissingMovies;
|
||||
|
@ -76,7 +76,7 @@ public void should_not_contain_recycling_bin_or_system_volume_information_for_ro
|
||||
.Returns(_folders);
|
||||
|
||||
var result = Subject.LookupContents(root, false, false);
|
||||
|
||||
|
||||
result.Directories.Should().HaveCount(_folders.Count - 3);
|
||||
|
||||
result.Directories.Should().NotContain(f => f.Name == RECYCLING_BIN);
|
||||
|
@ -62,7 +62,7 @@ public void should_throw_if_drive_doesnt_exist()
|
||||
{
|
||||
if (new DriveInfo(driveletter.ToString()).IsReady)
|
||||
continue;
|
||||
|
||||
|
||||
Assert.Throws<DirectoryNotFoundException>(() => Subject.GetAvailableSpace(driveletter + @":\NOT_A_REAL_PATH\DOES_NOT_EXIST".AsOsAgnostic()));
|
||||
return;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public void should_preserver_no_browser(string arg, string preserved)
|
||||
args.PreservedArguments.Should().Be(preserved);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_preserver_both()
|
||||
{
|
||||
|
@ -301,7 +301,7 @@ public void FolderSetLastWriteTime(string path, DateTime dateTime)
|
||||
public void FileSetLastWriteTime(string path, DateTime dateTime)
|
||||
{
|
||||
Ensure.That(path, () => path).IsValidPath();
|
||||
|
||||
|
||||
if (dateTime.Before(DateTimeExtensions.Epoch))
|
||||
{
|
||||
dateTime = DateTimeExtensions.Epoch;
|
||||
|
@ -97,7 +97,7 @@ public bool IsRooted
|
||||
{
|
||||
return _path.StartsWith("/");
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ public OsPath Directory
|
||||
{
|
||||
return new OsPath(null);
|
||||
}
|
||||
|
||||
|
||||
return new OsPath(_path.Substring(0, index), _kind).AsDirectory();
|
||||
}
|
||||
}
|
||||
@ -136,7 +136,7 @@ public string FileName
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
return _path.Substring(index).Trim('\\', '/');
|
||||
}
|
||||
}
|
||||
|
@ -20,15 +20,15 @@ namespace NzbDrone.Common.EnsureThat.Resources {
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class ExceptionMessages {
|
||||
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal ExceptionMessages() {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
@ -42,7 +42,7 @@ internal ExceptionMessages() {
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
@ -56,7 +56,7 @@ internal ExceptionMessages() {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Empty collection is not allowed..
|
||||
/// </summary>
|
||||
@ -65,7 +65,7 @@ internal static string EnsureExtensions_IsEmptyCollection {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsEmptyCollection", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Empty Guid is not allowed..
|
||||
/// </summary>
|
||||
@ -74,7 +74,7 @@ internal static string EnsureExtensions_IsEmptyGuid {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsEmptyGuid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Expected an expression that evaluates to false..
|
||||
/// </summary>
|
||||
@ -83,7 +83,7 @@ internal static string EnsureExtensions_IsNotFalse {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotFalse", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' is not greater than limit '{1}'..
|
||||
/// </summary>
|
||||
@ -92,7 +92,7 @@ internal static string EnsureExtensions_IsNotGt {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotGt", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' is not greater than or equal to limit '{1}'..
|
||||
/// </summary>
|
||||
@ -101,7 +101,7 @@ internal static string EnsureExtensions_IsNotGte {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotGte", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' is > max '{1}'..
|
||||
/// </summary>
|
||||
@ -110,7 +110,7 @@ internal static string EnsureExtensions_IsNotInRange_ToHigh {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotInRange_ToHigh", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The string is too long. Must be between '{0}' and '{1}'. Must be between '{0}' and '{1}' but was '{2}' characters long..
|
||||
/// </summary>
|
||||
@ -119,7 +119,7 @@ internal static string EnsureExtensions_IsNotInRange_ToLong {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotInRange_ToLong", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' is < min '{1}'..
|
||||
/// </summary>
|
||||
@ -128,7 +128,7 @@ internal static string EnsureExtensions_IsNotInRange_ToLow {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotInRange_ToLow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The string is not long enough. Must be between '{0}' and '{1}' but was '{2}' characters long..
|
||||
/// </summary>
|
||||
@ -137,7 +137,7 @@ internal static string EnsureExtensions_IsNotInRange_ToShort {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotInRange_ToShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' is not lower than limit '{1}'..
|
||||
/// </summary>
|
||||
@ -146,7 +146,7 @@ internal static string EnsureExtensions_IsNotLt {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotLt", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' is not lower than or equal to limit '{1}'..
|
||||
/// </summary>
|
||||
@ -155,7 +155,7 @@ internal static string EnsureExtensions_IsNotLte {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotLte", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Value can not be null..
|
||||
/// </summary>
|
||||
@ -164,7 +164,7 @@ internal static string EnsureExtensions_IsNotNull {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotNull", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The string can't be null or empty..
|
||||
/// </summary>
|
||||
@ -173,7 +173,7 @@ internal static string EnsureExtensions_IsNotNullOrEmpty {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotNullOrEmpty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The string can't be left empty, null or consist of only whitespaces..
|
||||
/// </summary>
|
||||
@ -182,7 +182,7 @@ internal static string EnsureExtensions_IsNotNullOrWhiteSpace {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotNullOrWhiteSpace", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The param is not of expected type: '{0}'..
|
||||
/// </summary>
|
||||
@ -191,7 +191,7 @@ internal static string EnsureExtensions_IsNotOfType {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotOfType", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Expected an expression that evaluates to true..
|
||||
/// </summary>
|
||||
@ -200,7 +200,7 @@ internal static string EnsureExtensions_IsNotTrue {
|
||||
return ResourceManager.GetString("EnsureExtensions_IsNotTrue", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to value '{0}' does not match '{1}'.
|
||||
/// </summary>
|
||||
@ -209,7 +209,7 @@ internal static string EnsureExtensions_NoMatch {
|
||||
return ResourceManager.GetString("EnsureExtensions_NoMatch", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No MemberExpression found in expression: '{0}'..
|
||||
/// </summary>
|
||||
|
@ -47,7 +47,7 @@ public void Register()
|
||||
{
|
||||
throw new RadarrStartupException("Cannot create AppFolder, Access to the path {0} is denied", _appFolderInfo.AppDataFolder);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (OsInfo.IsWindows)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ public static bool Between(this DateTime dateTime, DateTime afterDateTime, DateT
|
||||
{
|
||||
return dateTime >= afterDateTime && dateTime <= beforeDateTime;
|
||||
}
|
||||
|
||||
|
||||
public static DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public sealed class HttpAccept
|
||||
public static readonly HttpAccept JsonCharset = new HttpAccept("application/json;charset=utf-8");
|
||||
#endif
|
||||
public static readonly HttpAccept Html = new HttpAccept("text/html");
|
||||
|
||||
|
||||
public string Value { get; private set; }
|
||||
|
||||
public HttpAccept(string accept)
|
||||
|
@ -16,7 +16,7 @@ public class CleanseLogMessage
|
||||
new Regex(@"iptorrents\.com/[/a-z0-9?&;]*?(?:[?&;](u|tp)=(?<secret>[^&=;]+?))+(?= |;|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new Regex(@"/fetch/[a-z0-9]{32}/(?<secret>[a-z0-9]{32})", RegexOptions.Compiled),
|
||||
new Regex(@"getnzb.*?(?<=\?|&)(r)=(?<secret>[^&=]+?)(?= |&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
||||
|
||||
// Path
|
||||
new Regex(@"""C:\\Users\\(?<secret>[^\""]+?)(\\|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
new Regex(@"""/home/(?<secret>[^/""]+?)(/|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||
|
@ -57,7 +57,7 @@ public class SentryTarget : TargetWithLayout
|
||||
private static readonly HashSet<string> IncludeExceptionMessageTypes = new HashSet<string> {
|
||||
"SQLiteException"
|
||||
};
|
||||
|
||||
|
||||
private static readonly IDictionary<LogLevel, SentryLevel> LoggingLevelMap = new Dictionary<LogLevel, SentryLevel>
|
||||
{
|
||||
{LogLevel.Debug, SentryLevel.Debug},
|
||||
@ -244,7 +244,7 @@ public bool IsSentryMessage(LogEventInfo logEvent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (FilteredExceptionMessages.Any(x => logEvent.Exception.Message.Contains(x)))
|
||||
{
|
||||
return false;
|
||||
|
@ -55,7 +55,7 @@ static OAuthTools()
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Generates a random 16-byte lowercase alphanumeric string.
|
||||
/// Generates a random 16-byte lowercase alphanumeric string.
|
||||
/// </summary>
|
||||
/// <seealso href="http://oauth.net/core/1.0#nonce"/>
|
||||
/// <returns></returns>
|
||||
@ -259,7 +259,7 @@ public static string ConstructRequestUrl(Uri url)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a request elements concatentation value to send with a request.
|
||||
/// Creates a request elements concatentation value to send with a request.
|
||||
/// This is also known as the signature base.
|
||||
/// </summary>
|
||||
/// <seealso href="http://oauth.net/core/1.0#rfc.section.9.1.3"/>
|
||||
@ -276,7 +276,7 @@ public static string ConcatenateRequestElements(string method, string url, WebPa
|
||||
var requestMethod = string.Concat(method.ToUpper(), "&");
|
||||
var requestUrl = string.Concat(UrlEncodeRelaxed(ConstructRequestUrl(new Uri(url))), "&");
|
||||
var requestParameters = UrlEncodeRelaxed(NormalizeRequestParameters(parameters));
|
||||
|
||||
|
||||
sb.Append(requestMethod);
|
||||
sb.Append(requestUrl);
|
||||
sb.Append(requestParameters);
|
||||
@ -293,7 +293,7 @@ public static string ConcatenateRequestElements(string method, string url, WebPa
|
||||
/// <param name="signatureBase">The signature base</param>
|
||||
/// <param name="consumerSecret">The consumer key</param>
|
||||
/// <returns></returns>
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
string signatureBase,
|
||||
string consumerSecret)
|
||||
{
|
||||
@ -311,7 +311,7 @@ public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
/// <param name="consumerSecret">The consumer key</param>
|
||||
/// <returns></returns>
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
OAuthSignatureTreatment signatureTreatment,
|
||||
OAuthSignatureTreatment signatureTreatment,
|
||||
string signatureBase,
|
||||
string consumerSecret)
|
||||
{
|
||||
@ -327,7 +327,7 @@ public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
/// <param name="consumerSecret">The consumer secret</param>
|
||||
/// <param name="tokenSecret">The token secret</param>
|
||||
/// <returns></returns>
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
string signatureBase,
|
||||
string consumerSecret,
|
||||
string tokenSecret)
|
||||
@ -345,7 +345,7 @@ public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
/// <param name="consumerSecret">The consumer secret</param>
|
||||
/// <param name="tokenSecret">The token secret</param>
|
||||
/// <returns></returns>
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
public static string GetSignature(OAuthSignatureMethod signatureMethod,
|
||||
OAuthSignatureTreatment signatureTreatment,
|
||||
string signatureBase,
|
||||
string consumerSecret,
|
||||
|
@ -15,7 +15,7 @@ public virtual WebParameter this[string name]
|
||||
get
|
||||
{
|
||||
var parameters = this.Where(p => p.Name.Equals(name));
|
||||
|
||||
|
||||
if(parameters.Count() == 0)
|
||||
{
|
||||
return null;
|
||||
@ -142,7 +142,7 @@ IEnumerator IEnumerable.GetEnumerator()
|
||||
|
||||
public virtual void Add(WebParameter parameter)
|
||||
{
|
||||
|
||||
|
||||
_parameters.Add(parameter);
|
||||
}
|
||||
|
||||
|
@ -11,17 +11,17 @@ public class LimitedConcurrencyLevelTaskScheduler : TaskScheduler
|
||||
/// <summary>Whether the current thread is processing work items.</summary>
|
||||
[ThreadStatic]
|
||||
private static bool _currentThreadIsProcessingItems;
|
||||
/// <summary>The list of tasks to be executed.</summary>
|
||||
private readonly LinkedList<Task> _tasks = new LinkedList<Task>(); // protected by lock(_tasks)
|
||||
/// <summary>The maximum concurrency level allowed by this scheduler.</summary>
|
||||
/// <summary>The list of tasks to be executed.</summary>
|
||||
private readonly LinkedList<Task> _tasks = new LinkedList<Task>(); // protected by lock(_tasks)
|
||||
/// <summary>The maximum concurrency level allowed by this scheduler.</summary>
|
||||
private readonly int _maxDegreeOfParallelism;
|
||||
/// <summary>Whether the scheduler is currently processing work items.</summary>
|
||||
private int _delegatesQueuedOrRunning = 0; // protected by lock(_tasks)
|
||||
/// <summary>Whether the scheduler is currently processing work items.</summary>
|
||||
private int _delegatesQueuedOrRunning = 0; // protected by lock(_tasks)
|
||||
|
||||
/// <summary>
|
||||
/// Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the
|
||||
/// specified degree of parallelism.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the
|
||||
/// specified degree of parallelism.
|
||||
/// </summary>
|
||||
/// <param name="maxDegreeOfParallelism">The maximum degree of parallelism provided by this scheduler.</param>
|
||||
public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism)
|
||||
{
|
||||
@ -29,12 +29,12 @@ public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism)
|
||||
_maxDegreeOfParallelism = maxDegreeOfParallelism;
|
||||
}
|
||||
|
||||
/// <summary>Queues a task to the scheduler.</summary>
|
||||
/// <summary>Queues a task to the scheduler.</summary>
|
||||
/// <param name="task">The task to be queued.</param>
|
||||
protected sealed override void QueueTask(Task task)
|
||||
{
|
||||
// Add the task to the list of tasks to be processed. If there aren't enough
|
||||
// delegates currently queued or running to process tasks, schedule another.
|
||||
// Add the task to the list of tasks to be processed. If there aren't enough
|
||||
// delegates currently queued or running to process tasks, schedule another.
|
||||
lock (_tasks)
|
||||
{
|
||||
_tasks.AddLast(task);
|
||||
@ -46,26 +46,26 @@ protected sealed override void QueueTask(Task task)
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Informs the ThreadPool that there's work to be executed for this scheduler.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Informs the ThreadPool that there's work to be executed for this scheduler.
|
||||
/// </summary>
|
||||
private void NotifyThreadPoolOfPendingWork()
|
||||
{
|
||||
ThreadPool.UnsafeQueueUserWorkItem(_ =>
|
||||
{
|
||||
// Note that the current thread is now processing work items.
|
||||
// Note that the current thread is now processing work items.
|
||||
// This is necessary to enable inlining of tasks into this thread.
|
||||
_currentThreadIsProcessingItems = true;
|
||||
try
|
||||
{
|
||||
// Process all available items in the queue.
|
||||
// Process all available items in the queue.
|
||||
while (true)
|
||||
{
|
||||
Task item;
|
||||
lock (_tasks)
|
||||
{
|
||||
// When there are no more items to be processed,
|
||||
// note that we're done processing, and get out.
|
||||
// When there are no more items to be processed,
|
||||
// note that we're done processing, and get out.
|
||||
if (_tasks.Count == 0)
|
||||
{
|
||||
--_delegatesQueuedOrRunning;
|
||||
@ -77,44 +77,44 @@ private void NotifyThreadPoolOfPendingWork()
|
||||
_tasks.RemoveFirst();
|
||||
}
|
||||
|
||||
// Execute the task we pulled out of the queue
|
||||
// Execute the task we pulled out of the queue
|
||||
base.TryExecuteTask(item);
|
||||
}
|
||||
}
|
||||
// We're done processing items on the current thread
|
||||
// We're done processing items on the current thread
|
||||
finally { _currentThreadIsProcessingItems = false; }
|
||||
}, null);
|
||||
}
|
||||
|
||||
/// <summary>Attempts to execute the specified task on the current thread.</summary>
|
||||
/// <summary>Attempts to execute the specified task on the current thread.</summary>
|
||||
/// <param name="task">The task to be executed.</param>
|
||||
/// <param name="taskWasPreviouslyQueued"></param>
|
||||
/// <returns>Whether the task could be executed on the current thread.</returns>
|
||||
/// <returns>Whether the task could be executed on the current thread.</returns>
|
||||
protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
|
||||
{
|
||||
// If this thread isn't already processing a task, we don't support inlining
|
||||
// If this thread isn't already processing a task, we don't support inlining
|
||||
if (!_currentThreadIsProcessingItems) return false;
|
||||
|
||||
// If the task was previously queued, remove it from the queue
|
||||
// If the task was previously queued, remove it from the queue
|
||||
if (taskWasPreviouslyQueued) TryDequeue(task);
|
||||
|
||||
// Try to run the task.
|
||||
// Try to run the task.
|
||||
return base.TryExecuteTask(task);
|
||||
}
|
||||
|
||||
/// <summary>Attempts to remove a previously scheduled task from the scheduler.</summary>
|
||||
/// <summary>Attempts to remove a previously scheduled task from the scheduler.</summary>
|
||||
/// <param name="task">The task to be removed.</param>
|
||||
/// <returns>Whether the task could be found and removed.</returns>
|
||||
/// <returns>Whether the task could be found and removed.</returns>
|
||||
protected sealed override bool TryDequeue(Task task)
|
||||
{
|
||||
lock (_tasks) return _tasks.Remove(task);
|
||||
}
|
||||
|
||||
/// <summary>Gets the maximum concurrency level supported by this scheduler.</summary>
|
||||
/// <summary>Gets the maximum concurrency level supported by this scheduler.</summary>
|
||||
public sealed override int MaximumConcurrencyLevel => _maxDegreeOfParallelism;
|
||||
|
||||
/// <summary>Gets an enumerable of the tasks currently scheduled on this scheduler.</summary>
|
||||
/// <returns>An enumerable of the tasks currently scheduled.</returns>
|
||||
/// <summary>Gets an enumerable of the tasks currently scheduled on this scheduler.</summary>
|
||||
/// <returns>An enumerable of the tasks currently scheduled.</returns>
|
||||
protected sealed override IEnumerable<Task> GetScheduledTasks()
|
||||
{
|
||||
bool lockTaken = false;
|
||||
|
@ -676,7 +676,7 @@ public enum UnregisteredResolutionActions
|
||||
{
|
||||
/// <summary>
|
||||
/// Attempt to resolve type, even if the type isn't registered.
|
||||
///
|
||||
///
|
||||
/// Registered types/options will always take precedence.
|
||||
/// </summary>
|
||||
AttemptResolve,
|
||||
@ -689,7 +689,7 @@ public enum UnregisteredResolutionActions
|
||||
/// <summary>
|
||||
/// Attempt to resolve unregistered type if requested type is generic
|
||||
/// and no registration exists for the specific generic parameters used.
|
||||
///
|
||||
///
|
||||
/// Registered types/options will always take precedence.
|
||||
/// </summary>
|
||||
GenericsOnly
|
||||
@ -904,7 +904,7 @@ public RegisterOptions UsingConstructor<RegisterType>(Expression<Func<RegisterTy
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Switches to a custom lifetime manager factory if possible.
|
||||
///
|
||||
///
|
||||
/// Usually used for RegisterOptions "To*" extension methods such as the ASP.Net per-request one.
|
||||
/// </summary>
|
||||
/// <param name="instance">RegisterOptions instance</param>
|
||||
@ -994,7 +994,7 @@ public TinyIoCContainer GetChildContainer()
|
||||
#region Registration
|
||||
/// <summary>
|
||||
/// Attempt to automatically register all non-generic classes and interfaces in the current app domain.
|
||||
///
|
||||
///
|
||||
/// If more than one class implements an interface then only one implementation will be registered
|
||||
/// although no error will be thrown.
|
||||
/// </summary>
|
||||
@ -1010,7 +1010,7 @@ public void AutoRegister()
|
||||
/// <summary>
|
||||
/// Attempt to automatically register all non-generic classes and interfaces in the current app domain.
|
||||
/// Types will only be registered if they pass the supplied registration predicate.
|
||||
///
|
||||
///
|
||||
/// If more than one class implements an interface then only one implementation will be registered
|
||||
/// although no error will be thrown.
|
||||
/// </summary>
|
||||
@ -1056,7 +1056,7 @@ public void AutoRegister(DuplicateImplementationActions duplicateAction, Func<Ty
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to automatically register all non-generic classes and interfaces in the specified assemblies
|
||||
///
|
||||
///
|
||||
/// If more than one class implements an interface then only one implementation will be registered
|
||||
/// although no error will be thrown.
|
||||
/// </summary>
|
||||
@ -1069,7 +1069,7 @@ public void AutoRegister(IEnumerable<Assembly> assemblies)
|
||||
/// <summary>
|
||||
/// Attempt to automatically register all non-generic classes and interfaces in the specified assemblies
|
||||
/// Types will only be registered if they pass the supplied registration predicate.
|
||||
///
|
||||
///
|
||||
/// If more than one class implements an interface then only one implementation will be registered
|
||||
/// although no error will be thrown.
|
||||
/// </summary>
|
||||
@ -1361,7 +1361,7 @@ public RegisterOptions Register<RegisterType>(Func<TinyIoCContainer, NamedParame
|
||||
|
||||
/// <summary>
|
||||
/// Register multiple implementations of a type.
|
||||
///
|
||||
///
|
||||
/// Internally this registers each implementation using the full name of the class as its registration name.
|
||||
/// </summary>
|
||||
/// <typeparam name="RegisterType">Type that each implementation implements</typeparam>
|
||||
@ -1374,7 +1374,7 @@ public MultiRegisterOptions RegisterMultiple<RegisterType>(IEnumerable<Type> imp
|
||||
|
||||
/// <summary>
|
||||
/// Register multiple implementations of a type.
|
||||
///
|
||||
///
|
||||
/// Internally this registers each implementation using the full name of the class as its registration name.
|
||||
/// </summary>
|
||||
/// <param name="registrationType">Type that each implementation implements</param>
|
||||
@ -1720,7 +1720,7 @@ public bool CanResolve(Type resolveType, string name, ResolveOptions options)
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <param name="resolveType">Type to resolve</param>
|
||||
@ -1736,7 +1736,7 @@ public bool CanResolve(Type resolveType, NamedParameterOverloads parameters)
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <param name="resolveType">Type to resolve</param>
|
||||
@ -1753,7 +1753,7 @@ public bool CanResolve(Type resolveType, string name, NamedParameterOverloads pa
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <param name="resolveType">Type to resolve</param>
|
||||
@ -1770,7 +1770,7 @@ public bool CanResolve(Type resolveType, NamedParameterOverloads parameters, Res
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <param name="resolveType">Type to resolve</param>
|
||||
@ -1845,7 +1845,7 @@ public bool CanResolve<ResolveType>(string name, ResolveOptions options)
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <typeparam name="ResolveType">Type to resolve</typeparam>
|
||||
@ -1862,7 +1862,7 @@ public bool CanResolve<ResolveType>(NamedParameterOverloads parameters)
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <typeparam name="ResolveType">Type to resolve</typeparam>
|
||||
@ -1880,7 +1880,7 @@ public bool CanResolve<ResolveType>(string name, NamedParameterOverloads paramet
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <typeparam name="ResolveType">Type to resolve</typeparam>
|
||||
@ -1898,7 +1898,7 @@ public bool CanResolve<ResolveType>(NamedParameterOverloads parameters, ResolveO
|
||||
///
|
||||
/// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists).
|
||||
/// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail.
|
||||
///
|
||||
///
|
||||
/// Note: Resolution may still fail if user defined factory registations fail to construct objects when called.
|
||||
/// </summary>
|
||||
/// <typeparam name="ResolveType">Type to resolve</typeparam>
|
||||
@ -2360,7 +2360,7 @@ private abstract class ObjectFactoryBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether to assume this factory sucessfully constructs its objects
|
||||
///
|
||||
///
|
||||
/// Generally set to true for delegate style factories as CanResolve cannot delve
|
||||
/// into the delegates they contain.
|
||||
/// </summary>
|
||||
@ -2638,7 +2638,7 @@ public void Dispose()
|
||||
|
||||
/// <summary>
|
||||
/// Stores an particular instance to return for a type
|
||||
///
|
||||
///
|
||||
/// Stores the instance with a weak reference
|
||||
/// </summary>
|
||||
private class WeakInstanceFactory : ObjectFactoryBase, IDisposable
|
||||
@ -3427,7 +3427,7 @@ private bool CanConstruct(ConstructorInfo ctor, NamedParameterOverloads paramete
|
||||
|
||||
var isParameterOverload = parameters.ContainsKey(parameter.Name);
|
||||
|
||||
//#if NETFX_CORE
|
||||
//#if NETFX_CORE
|
||||
// if (parameter.ParameterType.GetTypeInfo().IsPrimitive && !isParameterOverload)
|
||||
//#else
|
||||
if (parameter.ParameterType.IsPrimitive() && !isParameterOverload)
|
||||
@ -3578,7 +3578,7 @@ private static ObjectConstructor CreateObjectConstructionDelegateWithCache(Const
|
||||
|
||||
// We could lock the cache here, but there's no real side
|
||||
// effect to two threads creating the same ObjectConstructor
|
||||
// at the same time, compared to the cost of a lock for
|
||||
// at the same time, compared to the cost of a lock for
|
||||
// every creation.
|
||||
var constructorParams = constructor.GetParameters();
|
||||
var lambdaParams = Expression.Parameter(typeof(object[]), "parameters");
|
||||
|
@ -42,7 +42,7 @@ public void Setup()
|
||||
MapRepository.Instance.RegisterTypeConverter(typeof(List<EmbeddedType>), new EmbeddedDocumentConverter());
|
||||
MapRepository.Instance.RegisterTypeConverter(typeof(EmbeddedType), new EmbeddedDocumentConverter());
|
||||
MapRepository.Instance.RegisterTypeConverter(typeof(int), new Int32Converter());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ public void should_not_fail_if_series_tags_are_null()
|
||||
|
||||
c.Insert.IntoTable("Tags").Row(new
|
||||
{
|
||||
Label = "test"
|
||||
Label = "test"
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -15,7 +15,7 @@ public void should_not_fail_if_no_transmission()
|
||||
{
|
||||
var db = WithMigrationTestDb(c =>
|
||||
{
|
||||
c.Insert.IntoTable("DownloadClients").Row(new
|
||||
c.Insert.IntoTable("DownloadClients").Row(new
|
||||
{
|
||||
Enable = 1,
|
||||
Name = "Deluge",
|
||||
|
@ -15,7 +15,7 @@ public void should_not_fail_if_no_pushbullet()
|
||||
{
|
||||
var db = WithMigrationTestDb(c =>
|
||||
{
|
||||
c.Insert.IntoTable("Notifications").Row(new
|
||||
c.Insert.IntoTable("Notifications").Row(new
|
||||
{
|
||||
OnGrab = false,
|
||||
OnDownload = false,
|
||||
@ -71,7 +71,7 @@ public void should_add_deviceIds_setting_matching_deviceId()
|
||||
OnUpgrade = false,
|
||||
Name = "PushBullet",
|
||||
Implementation = "PushBullet",
|
||||
Settings = new
|
||||
Settings = new
|
||||
{
|
||||
ApiKey = "my_api_key",
|
||||
DeviceId = deviceId
|
||||
|
@ -20,7 +20,7 @@ public void should_replace_old_url(string oldUrl)
|
||||
{
|
||||
var db = WithMigrationTestDb(c =>
|
||||
{
|
||||
c.Insert.IntoTable("Indexers").Row(new
|
||||
c.Insert.IntoTable("Indexers").Row(new
|
||||
{
|
||||
Name = "Kickass_wrong_url",
|
||||
Implementation = "KickassTorrents",
|
||||
|
@ -64,7 +64,7 @@ public void should_parse_column_attributes(string sql)
|
||||
result.Columns.First().Name.Should().Be("MyId");
|
||||
result.Columns.First().Type.Should().BeNull();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_ignore_unknown_symbols()
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ public void Setup()
|
||||
_remoteEpisode = new RemoteMovie();
|
||||
_remoteEpisode.Release = new ReleaseInfo();
|
||||
_remoteEpisode.Movie = new Movie();
|
||||
|
||||
|
||||
_delayProfile = new DelayProfile();
|
||||
|
||||
Mocker.GetMock<IDelayProfileService>()
|
||||
|
@ -31,7 +31,7 @@ private void WithContainer(string container)
|
||||
{
|
||||
_remoteMovie.Release.Container = container;
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_return_true_if_no_container_specified()
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ private RemoteMovie GetRemoteMovie(QualityModel quality, Movie movie = null, Dow
|
||||
MovieTitle = "A Movie",
|
||||
},
|
||||
Movie = movie,
|
||||
|
||||
|
||||
Release = new ReleaseInfo()
|
||||
{
|
||||
PublishDate = DateTime.UtcNow,
|
||||
|
@ -119,7 +119,7 @@ protected void GivenSuccessfulDownload()
|
||||
.Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951".ToLower())
|
||||
.Callback(PrepareClientToReturnQueuedItem);
|
||||
}
|
||||
|
||||
|
||||
protected virtual void GivenTorrents(List<DelugeTorrent> torrents)
|
||||
{
|
||||
if (torrents == null)
|
||||
@ -134,7 +134,7 @@ protected virtual void GivenTorrents(List<DelugeTorrent> torrents)
|
||||
|
||||
protected void PrepareClientToReturnQueuedItem()
|
||||
{
|
||||
GivenTorrents(new List<DelugeTorrent>
|
||||
GivenTorrents(new List<DelugeTorrent>
|
||||
{
|
||||
_queued
|
||||
});
|
||||
@ -142,7 +142,7 @@ protected void PrepareClientToReturnQueuedItem()
|
||||
|
||||
protected void PrepareClientToReturnDownloadingItem()
|
||||
{
|
||||
GivenTorrents(new List<DelugeTorrent>
|
||||
GivenTorrents(new List<DelugeTorrent>
|
||||
{
|
||||
_downloading
|
||||
});
|
||||
@ -150,7 +150,7 @@ protected void PrepareClientToReturnDownloadingItem()
|
||||
|
||||
protected void PrepareClientToReturnFailedItem()
|
||||
{
|
||||
GivenTorrents(new List<DelugeTorrent>
|
||||
GivenTorrents(new List<DelugeTorrent>
|
||||
{
|
||||
_failed
|
||||
});
|
||||
|
@ -565,7 +565,7 @@ public void should_not_fetch_details_twice()
|
||||
var item = Subject.GetItems().Single();
|
||||
item.CanBeRemoved.Should().BeFalse();
|
||||
item.CanMoveFiles.Should().BeFalse();
|
||||
|
||||
|
||||
var item2 = Subject.GetItems().Single();
|
||||
|
||||
Mocker.GetMock<IQBittorrentProxy>()
|
||||
|
@ -144,7 +144,7 @@ protected void GivenSuccessfulDownload()
|
||||
.Setup(s => s.AddTorrentFromData(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<TransmissionSettings>()))
|
||||
.Callback(PrepareClientToReturnQueuedItem);
|
||||
}
|
||||
|
||||
|
||||
protected virtual void GivenTorrents(List<TransmissionTorrent> torrents)
|
||||
{
|
||||
if (torrents == null)
|
||||
@ -159,7 +159,7 @@ protected virtual void GivenTorrents(List<TransmissionTorrent> torrents)
|
||||
|
||||
protected void PrepareClientToReturnQueuedItem()
|
||||
{
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
{
|
||||
_queued
|
||||
});
|
||||
@ -167,7 +167,7 @@ protected void PrepareClientToReturnQueuedItem()
|
||||
|
||||
protected void PrepareClientToReturnDownloadingItem()
|
||||
{
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
{
|
||||
_downloading
|
||||
});
|
||||
@ -175,7 +175,7 @@ protected void PrepareClientToReturnDownloadingItem()
|
||||
|
||||
protected void PrepareClientToReturnFailedItem()
|
||||
{
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
GivenTorrents(new List<TransmissionTorrent>
|
||||
{
|
||||
_failed
|
||||
});
|
||||
|
@ -74,7 +74,7 @@ public void Download_report_should_publish_on_grab_event()
|
||||
{
|
||||
var mock = WithUsenetClient();
|
||||
mock.Setup(s => s.Download(It.IsAny<RemoteMovie>()));
|
||||
|
||||
|
||||
Subject.DownloadReport(_parseResult);
|
||||
|
||||
VerifyEventPublished<MovieGrabbedEvent>();
|
||||
@ -85,7 +85,7 @@ public void Download_report_should_grab_using_client()
|
||||
{
|
||||
var mock = WithUsenetClient();
|
||||
mock.Setup(s => s.Download(It.IsAny<RemoteMovie>()));
|
||||
|
||||
|
||||
Subject.DownloadReport(_parseResult);
|
||||
|
||||
mock.Verify(s => s.Download(It.IsAny<RemoteMovie>()), Times.Once());
|
||||
@ -109,7 +109,7 @@ public void Download_report_should_trigger_indexer_backoff_on_indexer_error()
|
||||
var mock = WithUsenetClient();
|
||||
mock.Setup(s => s.Download(It.IsAny<RemoteMovie>()))
|
||||
.Callback<RemoteMovie>(v => {
|
||||
throw new ReleaseDownloadException(v.Release, "Error", new WebException());
|
||||
throw new ReleaseDownloadException(v.Release, "Error", new WebException());
|
||||
});
|
||||
|
||||
Assert.Throws<ReleaseDownloadException>(() => Subject.DownloadReport(_parseResult));
|
||||
@ -128,7 +128,7 @@ public void Download_report_should_trigger_indexer_backoff_on_http429_with_long_
|
||||
var mock = WithUsenetClient();
|
||||
mock.Setup(s => s.Download(It.IsAny<RemoteMovie>()))
|
||||
.Callback<RemoteMovie>(v => {
|
||||
throw new ReleaseDownloadException(v.Release, "Error", new TooManyRequestsException(request, response));
|
||||
throw new ReleaseDownloadException(v.Release, "Error", new TooManyRequestsException(request, response));
|
||||
});
|
||||
|
||||
Assert.Throws<ReleaseDownloadException>(() => Subject.DownloadReport(_parseResult));
|
||||
|
@ -69,7 +69,7 @@ public void Setup()
|
||||
Mocker.GetMock<IMovieService>()
|
||||
.Setup(s => s.GetMovie(It.IsAny<int>()))
|
||||
.Returns(_movie);
|
||||
|
||||
|
||||
Mocker.GetMock<IMovieService>()
|
||||
.Setup(s => s.GetMovies(It.IsAny<IEnumerable<int>>()))
|
||||
.Returns(new List<Movie> { _movie });
|
||||
|
@ -9,7 +9,7 @@
|
||||
namespace NzbDrone.Core.Test
|
||||
{
|
||||
[TestFixture]
|
||||
|
||||
|
||||
public class FluentTest : CoreTest
|
||||
{
|
||||
[TestCase(null, "def", "def")]
|
||||
@ -87,10 +87,10 @@ public void ToBestDateTime_Before_Yesterday()
|
||||
[Test]
|
||||
public void MaxOrDefault_should_return_zero_when_collection_is_empty()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var result = (new List<int>()).MaxOrDefault();
|
||||
|
||||
//Resolve
|
||||
@ -100,10 +100,10 @@ public void MaxOrDefault_should_return_zero_when_collection_is_empty()
|
||||
[Test]
|
||||
public void MaxOrDefault_should_return_max_when_collection_is_not_empty()
|
||||
{
|
||||
|
||||
|
||||
var list = new List<int> { 6, 4, 5, 3, 8, 10 };
|
||||
|
||||
|
||||
|
||||
var result = list.MaxOrDefault();
|
||||
|
||||
//Resolve
|
||||
@ -113,10 +113,10 @@ public void MaxOrDefault_should_return_max_when_collection_is_not_empty()
|
||||
[Test]
|
||||
public void MaxOrDefault_should_return_zero_when_collection_is_null()
|
||||
{
|
||||
|
||||
|
||||
List<int> list = null;
|
||||
|
||||
|
||||
|
||||
var result = list.MaxOrDefault();
|
||||
|
||||
//Resolve
|
||||
@ -126,10 +126,10 @@ public void MaxOrDefault_should_return_zero_when_collection_is_null()
|
||||
[Test]
|
||||
public void Truncate_should_truncate_strings_to_max_specified_number_of_bytes()
|
||||
{
|
||||
|
||||
|
||||
var str = ReadAllText("Files/LongOverview.txt");
|
||||
|
||||
|
||||
|
||||
var resultString = str.Truncate(1000);
|
||||
|
||||
//Resolve
|
||||
@ -140,10 +140,10 @@ public void Truncate_should_truncate_strings_to_max_specified_number_of_bytes()
|
||||
[Test]
|
||||
public void Truncate_should_not_truncate_string_shorter_than_max_bytes()
|
||||
{
|
||||
|
||||
|
||||
var str = "Hello World";
|
||||
|
||||
|
||||
|
||||
var resultString = str.Truncate(1000);
|
||||
|
||||
//Resolve
|
||||
@ -154,10 +154,10 @@ public void Truncate_should_not_truncate_string_shorter_than_max_bytes()
|
||||
[Test]
|
||||
public void MinOrDefault_should_return_zero_when_collection_is_empty()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var result = (new List<int>()).MinOrDefault();
|
||||
|
||||
//Resolve
|
||||
@ -167,10 +167,10 @@ public void MinOrDefault_should_return_zero_when_collection_is_empty()
|
||||
[Test]
|
||||
public void MinOrDefault_should_return_min_when_collection_is_not_empty()
|
||||
{
|
||||
|
||||
|
||||
var list = new List<int> { 6, 4, 5, 3, 8, 10 };
|
||||
|
||||
|
||||
|
||||
var result = list.MinOrDefault();
|
||||
|
||||
//Resolve
|
||||
@ -180,10 +180,10 @@ public void MinOrDefault_should_return_min_when_collection_is_not_empty()
|
||||
[Test]
|
||||
public void MinOrDefault_should_return_zero_when_collection_is_null()
|
||||
{
|
||||
|
||||
|
||||
List<int> list = null;
|
||||
|
||||
|
||||
|
||||
var result = list.MinOrDefault();
|
||||
|
||||
//Resolve
|
||||
|
@ -25,7 +25,7 @@ public DirectDataMapper(IDatabase database)
|
||||
_providerFactory = dataMapper.ProviderFactory;
|
||||
_connectionString = dataMapper.ConnectionString;
|
||||
}
|
||||
|
||||
|
||||
private DbConnection OpenConnection()
|
||||
{
|
||||
var connection = _providerFactory.CreateConnection();
|
||||
|
@ -32,10 +32,10 @@ public void should_return_warning_when_completed_download_handling_not_configure
|
||||
public void should_return_warning_when_both_completeddownloadhandling_and_dronefactory_are_not_configured()
|
||||
{
|
||||
GivenCompletedDownloadHandling(false);
|
||||
|
||||
|
||||
Subject.Check().ShouldBeWarning();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_return_ok_when_no_issues_found()
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ public void should_parse_recent_feed_from_newznab_nzb_su()
|
||||
Mocker.GetMock<IHttpClient>()
|
||||
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
|
||||
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
|
||||
|
||||
|
||||
var releases = Subject.FetchRecent();
|
||||
|
||||
releases.Should().HaveCount(100);
|
||||
|
@ -35,7 +35,7 @@ public void should_parse_recent_feed_from_omgwtfnzbs()
|
||||
Mocker.GetMock<IHttpClient>()
|
||||
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
|
||||
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
|
||||
|
||||
|
||||
var releases = Subject.FetchRecent();
|
||||
|
||||
releases.Should().HaveCount(100);
|
||||
|
@ -31,13 +31,13 @@ public List<ValidationFailure> TestPublic()
|
||||
/// </summary>
|
||||
private void SetupNLog()
|
||||
{
|
||||
// Step 1. Create configuration object
|
||||
// Step 1. Create configuration object
|
||||
var config = new LoggingConfiguration();
|
||||
|
||||
var fileTarget = new FileTarget();
|
||||
config.AddTarget("file", fileTarget);
|
||||
|
||||
// Step 3. Set target properties
|
||||
// Step 3. Set target properties
|
||||
fileTarget.FileName = "${basedir}/log.txt";
|
||||
fileTarget.Layout = GetStandardLayout();
|
||||
|
||||
|
@ -36,10 +36,10 @@ public void Setup()
|
||||
private void ExecuteAndVerifyCommand(Movie movie)
|
||||
{
|
||||
Subject.HandleAsync(new MovieUpdatedEvent(movie));
|
||||
|
||||
|
||||
Mocker.GetMock<IManageCommandQueue>()
|
||||
.Verify(v => v.Push(It.Is<EnsureMediaCoversCommand>(c => c.MovieId == movie.Id), It.IsAny<CommandPriority>(), It.IsAny<CommandTrigger>()), Times.Once());
|
||||
|
||||
|
||||
Subject.Execute(new EnsureMediaCoversCommand(movie.Id));
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ public void should_not_update_files_if_media_info_disabled()
|
||||
Mocker.GetMock<IConfigService>()
|
||||
.SetupGet(s => s.EnableMediaInfo)
|
||||
.Returns(false);
|
||||
|
||||
|
||||
GivenFileExists();
|
||||
GivenSuccessfulScan();
|
||||
|
||||
@ -222,7 +222,7 @@ public void should_not_update_if_media_info_disabled()
|
||||
Mocker.GetMock<IConfigService>()
|
||||
.SetupGet(s => s.EnableMediaInfo)
|
||||
.Returns(false);
|
||||
|
||||
|
||||
GivenFileExists();
|
||||
GivenSuccessfulScan();
|
||||
|
||||
@ -254,7 +254,7 @@ public void should_update_media_info()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Verify(v => v.Update(movieFile), Times.Once());
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_not_update_media_info_if_new_info_is_null()
|
||||
{
|
||||
@ -270,7 +270,7 @@ public void should_not_update_media_info_if_new_info_is_null()
|
||||
|
||||
movieFile.MediaInfo.Should().NotBeNull();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_not_save_movie_file_if_new_info_is_null()
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace NzbDrone.Core.Test.MediaFiles.MovieImport.Aggregation.Aggregators
|
||||
{
|
||||
[TestFixture]
|
||||
[TestFixture]
|
||||
public class AggregateLanguageFixture : CoreTest<AggregateLanguage>
|
||||
{
|
||||
private LocalMovie _localMovie;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace NzbDrone.Core.Test.MediaFiles.MovieImport.Aggregation.Aggregators
|
||||
{
|
||||
[TestFixture]
|
||||
[TestFixture]
|
||||
public class AugmentQualityFixture : CoreTest<AggregateQuality>
|
||||
{
|
||||
private Mock<IAugmentQuality> _mediaInfoAugmenter;
|
||||
|
@ -60,7 +60,7 @@ public void should_not_update_if_unable_to_parse()
|
||||
ExecuteCommand();
|
||||
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(s => s.Update(It.IsAny<MovieFile>()), Times.Never());
|
||||
}
|
||||
|
||||
|
@ -95,12 +95,12 @@ public void should_queue_multiple_async_events()
|
||||
|
||||
var handlers = new List<IHandleAsync<EventA>>
|
||||
{
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
AsyncHandlerA1.Object,
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,7 @@ public override ValidationResult Test()
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -61,7 +61,7 @@ private void GivenMatchingMovie()
|
||||
{
|
||||
ImdbId = "tt01000",
|
||||
Title = "Does not exist"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user