diff --git a/IISExpress/AppServer/applicationhost.config b/IISExpress/AppServer/applicationhost.config index f1e3a3538..c04eb1d2c 100644 --- a/IISExpress/AppServer/applicationhost.config +++ b/IISExpress/AppServer/applicationhost.config @@ -125,7 +125,7 @@ - + diff --git a/IISExpress/iisexpress.exe.manifest b/IISExpress/iisexpress.exe.manifest new file mode 100644 index 000000000..20778a00a --- /dev/null +++ b/IISExpress/iisexpress.exe.manifest @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Libraries/FluentAssertions.dll b/Libraries/FluentAssertions.dll index cd2ffbf5a..0e091fd15 100644 Binary files a/Libraries/FluentAssertions.dll and b/Libraries/FluentAssertions.dll differ diff --git a/Libraries/FluentAssertions.xml b/Libraries/FluentAssertions.xml index 76cc4d4bb..0ff33172f 100644 --- a/Libraries/FluentAssertions.xml +++ b/Libraries/FluentAssertions.xml @@ -4,60 +4,223 @@ FluentAssertions - + - Provides a fluent API for verifying an arbitrary condition. + Initializes a new instance of the class. - + - Initializes a new instance of the class. + Contains extension methods for custom assertions in unit tests. - + - Gets the name or identifier of the current subject, or a default value if the subject is not known. + Invokes the specified action on an subject so that you can chain it with any of the ShouldThrow or ShouldNotThrow + overloads. - + - Indicates that every argument passed into is displayed on a separate line. + Provides methods for asserting the execution time of a method or property. + The object that exposes the method or property. + A reference to the method or property to measure the execution time of. + + Returns an object for asserting that the execution time matches certain conditions. + - + - Gets or sets the name of the subject for the next verification. + Provides methods for asserting the execution time of a method or property. + The object that exposes the method or property. + A reference to the method or property to measure the execution time of. + + Returns an object for asserting that the execution time matches certain conditions. + - + - The amount of time that a should exceed compared to another . + Asserts that the throws an exception. + + The type of the exception it should throw. + + + Returns an object that allows asserting additional members of the thrown exception. + - + - The amount of time that a should be equal or exceed compared to another . + Asserts that the throws an exception. + + The type of the exception it should throw. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + Returns an object that allows asserting additional members of the thrown exception. + - + - The amount of time that a should differ exactly compared to another . + Asserts that the does not throw a particular exception. + + The type of the exception it should not throw. Any other exceptions are ignored and will satisfy the assertion. + - + - The maximum amount of time that a should differ compared to another . + Asserts that the does not throw a particular exception. + + The type of the exception it should not throw. Any other exceptions are ignored and will satisfy the assertion. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + - + - The amount of time that a should be within another . + Asserts that the does not throw any exception at all. - + - Gets the object which value is being asserted. + Asserts that the does not throw any exception at all. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Forces enumerating a collection. Should be used to assert that a method that uses the + yield keyword throws a particular exception. + + + + + Forces enumerating a collection. Should be used to assert that a method that uses the + yield keyword throws a particular exception. + + + + + Asserts that the properties of an object matches those of another object. + + + + + Safely casts the specified object to the type specified through . + + + Has been introduced to allow casting objects without breaking the fluent API. + + + + + + Asserts that the current throws an exception of type . + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current does not throw an exception of type . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current does not throw any exception. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the value is false. + + + + + Asserts that the value is false. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the value is true. + + + + + Asserts that the value is true. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the value is equal to the specified value. + + + + + Asserts that the value is equal to the specified value. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + @@ -77,7 +240,7 @@ The type to which the object should be assignable. The reason why the object should be assignable to the type. - The parameters used when formatting the . + The parameters used when formatting the . An which can be used to chain assertions. @@ -93,7 +256,7 @@ The predicate which must be statisfied by the . The reason why the predicate should be satisfied. - The parameters used when formatting the . + The parameters used when formatting the . An which can be used to chain assertions. @@ -109,7 +272,7 @@ The predicate which must be statisfied by the . The reason why the predicate should be satisfied. - The parameters used when formatting the . + The parameters used when formatting the . An which can be used to chain assertions. @@ -119,346 +282,421 @@ - Asserts that the number of items in the collection matches the supplied amount. + Asserts that the number of items in the collection matches the supplied amount. - Asserts that the number of items in the collection matches the supplied amount. + Asserts that the number of items in the collection matches the supplied amount. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the number of items in the collection matches a condition stated by a predicate. + Asserts that the number of items in the collection matches a condition stated by the . - Asserts that the number of items in the collection matches a condition stated by a predicate. + Asserts that the number of items in the collection matches a condition stated by the . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the collection does not contain any items. + Asserts that the collection does not contain any items. - Asserts that the collection does not contain any items. + Asserts that the collection does not contain any items. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the collection contains at least 1 item. + Asserts that the collection contains at least 1 item. - Asserts that the collection contains at least 1 item. + Asserts that the collection contains at least 1 item. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the collection does not contain any duplicate items. + Asserts that the collection does not contain any duplicate items. - Asserts that the collection does not contain any duplicate items. + Asserts that the collection does not contain any duplicate items. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the collection does not contain any null items. + Asserts that the collection does not contain any null items. - Asserts that the collection does not contain any null items. + Asserts that the collection does not contain any null items. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Expects the current collection to contain all the same elements in the same order as the collection identified by - . Elements are compared using their . + Expects the current collection to contain all the same elements in the same order as the collection identified by + . Elements are compared using their . - Expects the current collection to contain all the same elements in the same order as the collection identified by - . Elements are compared using their . + Expects the current collection to contain all the same elements in the same order as the collection identified by + . Elements are compared using their . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Expects the current collection to contain all the same elements in the same order as the collection identified by - . Elements are compared using their . + Expects the current collection to contain all the same elements in the same order as the collection identified by + . Elements are compared using their . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Expects the current collection not to contain all the same elements in the same order as the collection identified by - . Elements are compared using their . + Expects the current collection not to contain all the same elements in the same order as the collection identified by + . Elements are compared using their . - Expects the current collection not to contain all the same elements in the same order as the collection identified by - . Elements are compared using their . + Expects the current collection not to contain all the same elements in the same order as the collection identified by + . Elements are compared using their . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Expects the current collection to contain all elements of the collection identified by , - regardless of the order. Elements are compared using their . + Expects the current collection to contain all elements of the collection identified by , + regardless of the order. Elements are compared using their . - Expects the current collection to contain all elements of the collection identified by , - regardless of the order. Elements are compared using their . + Expects the current collection to contain all elements of the collection identified by , + regardless of the order. Elements are compared using their . - Expects the current collection to contain all elements of the collection identified by , - regardless of the order. Elements are compared using their . + Expects the current collection to contain all elements of the collection identified by , + regardless of the order. Elements are compared using their . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Expects the current collection not to contain all elements of the collection identified by , - regardless of the order. Elements are compared using their . + Expects the current collection not to contain all elements of the collection identified by , + regardless of the order. Elements are compared using their . - + - Expects the current collection not to contain all elements of the collection identified by , - regardless of the order. Elements are compared using their . + Expects the current collection not to contain all elements of the collection identified by , + regardless of the order. Elements are compared using their . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the current collection only contains items that are assignable to the type . + Asserts that the current collection only contains items that are assignable to the type . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Expects the current collection to contain the specified elements in any order. Elements are compared - using their implementation. + Expects the current collection to contain the specified elements in any order. Elements are compared + using their implementation. - Expects the current collection to contain the specified elements in any order. Elements are compared - using their implementation. + Expects the current collection to contain the specified elements in any order. Elements are compared + using their implementation. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Expects the current collection to contain the specified elements in the exact same order. Elements are compared - using their implementation. + Expects the current collection to contain the specified elements in the exact same order. Elements are compared + using their implementation. - Expects the current collection to contain the specified elements in the exact same order. Elements are compared - using their implementation. + Expects the current collection to contain the specified elements in the exact same order. Elements are compared + using their implementation. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the collection is a subset of the . + Asserts that the collection is a subset of the . - Asserts that the collection is a subset of the . + Asserts that the collection is a subset of the . - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. - Zero or more objects to format using the placeholders in . + Zero or more objects to format using the placeholders in . - Asserts that the collection is not a subset of the . + Asserts that the collection is not a subset of the . - Asserts that the collection is not a subset of the . + Asserts that the collection is not a subset of the . - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. - Zero or more objects to format using the placeholders in . + Zero or more objects to format using the placeholders in . - Assert that the current collection has the same number of elements as . + Assert that the current collection has the same number of elements as . - Assert that the current collection has the same number of elements as . + Assert that the current collection has the same number of elements as . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the current collection has not been initialized yet with an actual collection. + Asserts that the current collection has not been initialized yet with an actual collection. - Asserts that the current collection has not been initialized yet with an actual collection. + Asserts that the current collection has not been initialized yet with an actual collection. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the current collection has been initialized with an actual collection. + Asserts that the current collection has been initialized with an actual collection. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the current collection has been initialized with an actual collection. + Asserts that the current collection has been initialized with an actual collection. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the current collection has the supplied at the supplied . + Asserts that the current collection has the supplied at the + supplied . - Asserts that the current collection has the supplied at the supplied . + Asserts that the current collection has the supplied at the + supplied . + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - Asserts that the current collection only contains items that are assignable to the type . + Asserts that the current collection only contains items that are assignable to the type . - Asserts that the current collection does not contain the supplied item. + Asserts that the current collection does not contain the supplied item. - Asserts that the current collection does not contain the supplied item. - - - - - Asserts that the collection contains the specified item. - - - - - Asserts that the collection contains the specified item. + Asserts that the current collection does not contain the supplied item. - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. - - Zero or more values to use for filling in any compatible placeholders. + + Zero or more objects to format using the placeholders in . - - - Asserts that the collection contains some extra items in addition to the original items. - - - - - Asserts that the collection contains at least one item that matches the predicate. - - - + - Asserts that the collection contains at least one item that matches the predicate. + Asserts that the subject is considered equal to another object according to the implementation of . - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. + + The object to pass to the subject's method. - - - Asserts that the collection only contains items that match a predicate. - - - + - Asserts that the collection only contains items that match a predicate. + Asserts that the subject is considered equal to another object according to the implementation of . - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. + + The object to pass to the subject's method. - - - - Asserts that the collection does not contain any items that match the predicate. - - - - - Asserts that the collection does not contain any items that match the predicate. - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. - - Zero or more values to use for filling in any compatible placeholders. + + Zero or more objects to format using the placeholders in . - - - Provides services for formatting an object being used in an assertion in a human readable format. - - - - - A list of objects responsible for formatting the objects represented by placeholders. - - - - - Returns a human-readable representation of a particular object. - - - + - Returns a human-readable representation of a particular object that starts on a new line. + Asserts that the subject is not equal to another object according to its implementation of . + + The object to pass to the subject's method. + - + - Asserts a floating point value approximates another value as close as possible. + Asserts that the subject is not equal to another object according to its implementation of . - - The expected value to compare the actual value with. - - - The maximum amount of which the two values may differ. + + The object to pass to the subject's method. A formatted phrase as is supported by explaining why the assertion @@ -468,15 +706,12 @@ Zero or more objects to format using the placeholders in . - + - Asserts a floating point value approximates another value as close as possible. + Asserts that the subject is less than another object according to its implementation of . - - The expected value to compare the actual value with. - - - The maximum amount of which the two values may differ. + + The object to pass to the subject's method. A formatted phrase as is supported by explaining why the assertion @@ -486,15 +721,12 @@ Zero or more objects to format using the placeholders in . - + - Asserts a floating point value approximates another value as close as possible. + Asserts that the subject is less than another object according to its implementation of . - - The expected value to compare the actual value with. - - - The maximum amount of which the two values may differ. + + The object to pass to the subject's method. A formatted phrase as is supported by explaining why the assertion @@ -504,15 +736,20 @@ Zero or more objects to format using the placeholders in . - + - Asserts a floating point value approximates another value as close as possible. + Asserts that the subject is less than or equal to another object according to its implementation of . - - The expected value to compare the actual value with. + + The object to pass to the subject's method. - - The maximum amount of which the two values may differ. + + + + Asserts that the subject is less than or equal to another object according to its implementation of . + + + The object to pass to the subject's method. A formatted phrase as is supported by explaining why the assertion @@ -522,15 +759,20 @@ Zero or more objects to format using the placeholders in . - + - Asserts a floating point value approximates another value as close as possible. + Asserts that the subject is greater than another object according to its implementation of . - - The expected value to compare the actual value with. + + The object to pass to the subject's method. - - The maximum amount of which the two values may differ. + + + + Asserts that the subject is greater than another object according to its implementation of . + + + The object to pass to the subject's method. A formatted phrase as is supported by explaining why the assertion @@ -540,15 +782,20 @@ Zero or more objects to format using the placeholders in . - + - Asserts a floating point value approximates another value as close as possible. + Asserts that the subject is greater than or equal to another object according to its implementation of . - - The expected value to compare the actual value with. + + The object to pass to the subject's method. - - The maximum amount of which the two values may differ. + + + + Asserts that the subject is greater than or equal to another object according to its implementation of . + + + The object to pass to the subject's method. A formatted phrase as is supported by explaining why the assertion @@ -558,33 +805,32 @@ Zero or more objects to format using the placeholders in . - + - Asserts a floating point value approximates another value as close as possible. + Asserts that a value is within a range. - - The expected value to compare the actual value with. - - - The maximum amount of which the two values may differ. - - - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. + + Where the range is continuous or incremental depends on the actual type of the value. + + + The minimum valid value of the range. - - Zero or more objects to format using the placeholders in . + + The maximum valid value of the range. - + - Asserts a floating point value approximates another value as close as possible. + Asserts that a value is within a range. - - The expected value to compare the actual value with. + + Where the range is continuous or incremental depends on the actual type of the value. + + + The minimum valid value of the range. - - The maximum amount of which the two values may differ. + + The maximum valid value of the range. A formatted phrase as is supported by explaining why the assertion @@ -594,222 +840,1150 @@ Zero or more objects to format using the placeholders in . - + - Records activity for a single event. + Asserts that a nullable numeric value is not null. - + + + Asserts that a nullable numeric value is not null. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that a nullable numeric value is null. + + + + + Asserts that a nullable numeric value is null. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Defines the way compares the expected exception + message with the actual one. + + + + + The message must match exactly, including the casing of the characters. + + + + + The message must contain the expected message. + + + + + The message must match a wildcard pattern consisting of ordinary characters as well as * and ?. + + + + + Asserts that the current is exactly equal to the value. + + + + + Asserts that the current is exactly equal to the value. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current is before the specified value. + + + + + Asserts that the current is before the specified value. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current is either on, or before the specified value. + + + + + Asserts that the current is either on, or before the specified value. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current is after the specified value. + + + + + Asserts that the current is after the specified value. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current is either on, or after the specified value. + + + + + Asserts that the current is either on, or after the specified value. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current has the year. + + + + + Asserts that the current has the year. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current has the month. + + + + + Asserts that the current has the month. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current has the day. + + + + + Asserts that the current has the day. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current has the hour. + + + + + Asserts that the current has the hour. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current has the minute. + + + + + Asserts that the current has the minute. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current has the second. + + + + + Asserts that the current has the second. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Returns a object that can be used to assert that the current + exceeds the specified compared to another . + + + The amount of time that the current should exceed compared to another . + + + + + Returns a object that can be used to assert that the current + is equal to or exceeds the specified compared to another . + + + The amount of time that the current should be equal or exceed compared to + another . + + + + + Returns a object that can be used to assert that the current + differs exactly the specified compared to another . + + + The amount of time that the current should differ exactly compared to another . + + + + + Returns a object that can be used to assert that the current + is within the specified compared to another . + + + The amount of time that the current should be within another . + + + + + Returns a object that can be used to assert that the current + differs at maximum the specified compared to another . + + + The maximum amount of time that the current should differ compared to another . + + + + + Gets the object which value is being asserted. + + + + + Asserts that the thrown exception has a message that exactly matches the + + + The expected message of the exception. + + + + + Asserts that the thrown exception has a message that matches + depending on the specified matching mode. + + + The expected message of the exception. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the thrown exception has a message that matches + depending on the specified matching mode. + + + The expected message of the exception. + + + Determines how the expected message is compared with the actual message. + + + + + Asserts that the thrown exception has a message that matches + depending on the specified matching mode. + + + The expected message of the exception. + + + Determines how the expected message is compared with the actual message. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the thrown exception contains an inner exception of type . + + The expected type of the inner exception. + An which can be used to chain assertions. + + + + Asserts that the thrown exception contains an inner exception of type . + + The expected type of the inner exception. + The reason why the inner exception should be of the supplied type. + The parameters used when formatting the . + An which can be used to chain assertions. + + + + Asserts that the thrown exception contains an inner exception with the . + + The expected message of the inner exception. + An which can be used to chain assertions. + + + + Asserts that the thrown exception contains an inner exception with the . + + The expected message of the inner exception. + + The reason why the message of the inner exception should match . + + The parameters used when formatting the . + + + + Asserts that the exception matches a particular condition. + + + The condition that the exception must match. + + + + + Asserts that the exception matches a particular condition. + + + The condition that the exception must match. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Gets the exception object of the exception thrown. + + + + + Provides methods for asserting that the execution time of an satifies certain conditions. + + + + + Asserts that the execution time of the operation does not exceed a specified amount of time. + + + The maximum allowed duration. + + + + + Asserts that the execution time of the operation does not exceed a specified amount of time. + + + The maximum allowed duration. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Provides methods for asserting that the execution time of an object member satifies certain conditions. + + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts a floating point value approximates another value as close as possible. + + + The expected value to compare the actual value with. + + + The maximum amount of which the two values may differ. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the collection contains the specified item. + + + + + Asserts that the collection contains the specified item. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Asserts that the collection contains some extra items in addition to the original items. + + + + + Asserts that the collection contains at least one item that matches the predicate. + + + + + Asserts that the collection contains at least one item that matches the predicate. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Asserts that the collection only contains items that match a predicate. + + + + + Asserts that the collection only contains items that match a predicate. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Asserts that the collection does not contain any items that match the predicate. + + + + + Asserts that the collection does not contain any items that match the predicate. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. + + + + + Asserts that the current dictionary has not been initialized yet with an actual dictionary. + + + + + Asserts that the current dictionary has not been initialized yet with an actual dictionary. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the current dictionary has been initialized with an actual dictionary. + + + + + Asserts that the current dictionary has been initialized with an actual dictionary. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the number of items in the dictionary matches the supplied amount. + + + The expected amount. + + + + + Asserts that the number of items in the dictionary matches the supplied amount. + + + The expected amount. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the number of items in the dictionary matches a condition stated by a predicate. + + + The predicate which must be statisfied by the amount of items + + + + + Asserts that the number of items in the dictionary matches a condition stated by a predicate. + + + The predicate which must be statisfied by the amount of items + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the dictionary does not contain any items. + + + + + Asserts that the dictionary does not contain any items. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that the dictionary contains at least 1 item. + + + + + Asserts that the dictionary contains at least 1 item. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + - Records raised events for one event on one object + Asserts that the current dictionary contains all the same key-value pairs as the + specified dictionary. Keys and values are compared using + their implementation. + + The expected dictionary + - + - Store information about a raised event + Asserts that the current dictionary contains all the same key-value pairs as the + specified dictionary. Keys and values are compared using + their implementation. - Parameters the event was raised with + + The expected dictionary + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - The object events are recorded from + Asserts the current dictionary not to contain all the same key-value pairs as the + specified dictionary. Keys and values are compared using + their implementation. + + The unexpected dictionary + - + - The name of the event that's recorded + Asserts the current dictionary not to contain all the same key-value pairs as the + specified dictionary. Keys and values are compared using + their implementation. + + The unexpected dictionary + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + + Asserts that the dictionary contains the specified key. Keys are compared using + their implementation. - The object events are recorded from - The name of the event that's recorded + + The expected key + - + - Enumerate raised events + Asserts that the dictionary contains the specified key. Keys are compared using + their implementation. + + The expected key + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Enumerate raised events + Asserts that the dictionary contains all of the specified keys. Keys are compared using + their implementation. - + + The expected keys + - + - Called by the auto-generated IL, to record information about a raised event. + Asserts that the dictionary contains all of the specified keys. Keys are compared using + their implementation. + + The expected keys + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - The object events are recorded from + Asserts that the current dictionary does not contain the specified key. + Keys are compared using their implementation. + + The unexpected key + - + - The name of the event that's recorded + Asserts that the current dictionary does not contain the specified key. + Keys are compared using their implementation. + + The unexpected key + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Helper class for verifying a condition and/or throwing a test harness specific exception representing an assertion failure. + Asserts that the dictionary contains the specified value. Values are compared using + their implementation. + + The expected value + - + - Asserts that the supplied is met. + Asserts that the dictionary contains the specified value. Values are compared using + their implementation. - The condition to assert. - - The message that will be used in the exception. This should describe what was expected and why. This message - can contain the following three placeholders:
- - {0} = the expected value - {1} = the actual value - {2} = a reason explaining the expectations -
- Any additional placeholders are allowed and will be satisfied using the . + + The expected value - - The expected value, or null if there is no explicit expected value. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. - The actual value, or null if there is no explicit actual value. - Should describe the reason for the expectation. - Optional args for formatting placeholders in the . - - Optional arguments to satisfy any additional placeholders in the + + Zero or more objects to format using the placeholders in .
- + - Asserts that the supplied is met. + Asserts that the dictionary contains all of the specified values. Values are compared using + their implementation. - The condition to assert. - - The message that will be used in the exception. This should describe what was expected and why. This message - can contain the following three placeholders:
- - {0} = the expected value - {1} = the actual value - {2} = a reason explaining the expectations -
- Any additional placeholders are allowed and will be satisfied using the . + + The expected values - - The expected value, or null if there is no explicit expected value. +
+ + + Asserts that the dictionary contains all of the specified values. Values are compared using + their implementation. + + + The expected values - The actual value, or null if there is no explicit actual value. - Should describe the reason for the expectation. - Optional args for formatting placeholders in the . - - Optional arguments to satisfy any additional placeholders in the + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . - + - Handles an assertion failure. + Asserts that the current dictionary does not contain the specified value. + Values are compared using their implementation. - - The message that will be used in the exception. This should describe what was expected and why. This message - can contain the following three placeholders:
- - {0} = the expected value - {1} = the actual value - {2} = a reason explaining the expectations -
- Any additional placeholders are allowed and will be satisfied using the . + + The unexpected value - - The expected value, or null if there is no explicit expected value. +
+ + + Asserts that the current dictionary does not contain the specified value. + Values are compared using their implementation. + + + The unexpected value - The actual value, or null if there is no explicit actual value. - Should describe the reason for the expectation. - Optional args for formatting placeholders in the . - - Optional arguments to satisfy any additional placeholders in the + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . - + - Gets an object that wraps and executes a conditional or unconditional verification. + Asserts that the current dictionary contains the specified . + Keys and values are compared using their implementation. + + The to look for + - + - Gets the object which value is being asserted. + Asserts that the current dictionary contains the specified . + Keys and values are compared using their implementation. + + The to look for + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Is responsible for validating the equality of one or more properties of a subject with another object. + Asserts that the current dictionary contains the specified for the supplied . Values are compared using their implementation. + + The key for which to validate the value + + + The value to validate + - + - Returns a based on a number of seconds. + Asserts that the current dictionary contains the specified for the supplied . Values are compared using their implementation. + + The key for which to validate the value + + + The value to validate + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Returns a based on a number of seconds. + Asserts that the current dictionary does not contain the specified . + Keys and values are compared using their implementation. + + The to look for + - + - Returns a based on a number of minutes. + Asserts that the current dictionary does not contain the specified . + Keys and values are compared using their implementation. + + The to look for + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Returns a based on a number of hours. + Asserts that the current dictionary does not contain the specified for the + supplied . Values are compared using their implementation. + + The key for which to validate the value + + + The value to validate + - + - Returns a based on a number of days. + Asserts that the current dictionary does not contain the specified for the + supplied . Values are compared using their implementation. + + The key for which to validate the value + + + The value to validate + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Initializes a new instance of the class. + Gets the object which value is being asserted. - + - Static methods that aid in generic event subscription + Asserts that a value is within a range. + + Where the range is continuous or incremental depends on the actual type of the value. + + + The minimum valid value of the range. + + + The maximum valid value of the range. + - + - Generates an eventhandler for an event of type eventSignature that calls RegisterEvent on recorder - when invoked. + Asserts that a value is within a range. + + Where the range is continuous or incremental depends on the actual type of the value. + + + The minimum valid value of the range. + + + The maximum valid value of the range. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Finds the Return Type of a Delegate. + Asserts that a nullable numeric value is not null. - + - Returns an Array of Types that make up a delegate's parameter signature. + Asserts that a nullable numeric value is not null. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Returns an array of types appended with an EventRecorder reference at the beginning. + Asserts that a nullable numeric value is null. - + - Returns T/F Dependent on a Type Being a Delegate. + Asserts that a nullable numeric value is null. + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + - + - Returns the MethodInfo for the Delegate's "Invoke" Method. + Gets the object which value is being asserted. @@ -842,7 +2016,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -859,7 +2033,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -876,7 +2050,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -918,83 +2092,6 @@ Zero or more objects to format using the placeholders in . - - - Asserts that the thrown exception has a message matching the . - - The expected message of the exception. - - - - Asserts that the thrown exception has a message matching the . - - The expected message of the exception. - - The reason why the message of the exception should match the . - - The parameters used when formatting the . - - - - Asserts that the thrown exception contains an inner exception of type . - - The expected type of the inner exception. - An which can be used to chain assertions. - - - - Asserts that the thrown exception contains an inner exception of type . - - The expected type of the inner exception. - The reason why the inner exception should be of the supplied type. - The parameters used when formatting the . - An which can be used to chain assertions. - - - - Asserts that the thrown exception contains an inner exception with the . - - The expected message of the inner exception. - An which can be used to chain assertions. - - - - Asserts that the thrown exception contains an inner exception with the . - - The expected message of the inner exception. - - The reason why the message of the inner exception should match . - - The parameters used when formatting the . - - - - Asserts that the exception matches a particular condition. - - - The condition that the exception must match. - - - - - Asserts that the exception matches a particular condition. - - - The condition that the exception must match. - - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. - - - - - Gets the exception object of the exception thrown. - - Provides methods for selecting one or properties of an object and comparing them with another object. @@ -1019,207 +2116,52 @@ - Includes all properties of when comparing the subject with another object using , - except those specified using a property expression. - - - - - Includes only those properties of when comparing the subject with another object using - that were specified using a property expression. - - - - - Asserts that the previously selected properties of have the same value as the equally named - properties of . - - - Property values are considered equal if, after converting them to the requested type, calling - returns true. - - - - - Asserts that the previously selected properties of have the same value as the equally named - properties of . - - - Property values are considered equal if, after converting them to the requested type, calling - returns true. - - - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. - - - Zero or more objects to format using the placeholders in . - - - - - Gets the object which value is being asserted. - - - - - Contains extension methods for custom assertions in unit tests. - - - - - Invokes the specified action on an subject so that you can chain it with any of the ShouldThrow or ShouldNotThrow - overloads. - - - - - Provides methods for asserting the execution time of a method or property. - - The object that exposes the method or property. - A reference to the method or property to measure the execution time of. - - Returns an object for asserting that the execution time matches certain conditions. - - - - - Provides methods for asserting the execution time of a method or property. - - The object that exposes the method or property. - A reference to the method or property to measure the execution time of. - - Returns an object for asserting that the execution time matches certain conditions. - - - - - Asserts that the throws an exception. - - - The type of the exception it should throw. - - - Returns an object that allows asserting additional members of the thrown exception. - - - - - Asserts that the throws an exception. - - - The type of the exception it should throw. - - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. - - - Returns an object that allows asserting additional members of the thrown exception. - - - - - Asserts that the does not throw a particular exception. - - - The type of the exception it should not throw. Any other exceptions are ignored and will satisfy the assertion. - - - - - Asserts that the does not throw a particular exception. - - - The type of the exception it should not throw. Any other exceptions are ignored and will satisfy the assertion. - - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. - - - - - Asserts that the does not throw any exception at all. - - - - - Asserts that the does not throw any exception at all. - - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. - - - - - Forces enumerating a collection. Should be used to assert that a method that uses the - yield keyword throws a particular exception. - - - - - Forces enumerating a collection. Should be used to assert that a method that uses the - yield keyword throws a particular exception. + Includes all properties of when comparing the subject with another object using , + except those specified using a property expression. - + - Asserts that the properties of an object matches those of another object. + Includes only those properties of when comparing the subject with another object using + that were specified using a property expression. - + - Safely casts the specified object to the type specified through . + Asserts that the previously selected properties of have the same value as the equally named + properties of . - Has been introduced to allow casting objects without breaking the fluent API. + Property values are considered equal if, after converting them to the requested type, calling + returns true. - - - - Provides methods for asserting that the execution time of an satifies certain conditions. - - - + - Asserts that the execution time of the operation does not exceed a specified amount of time. + Asserts that the previously selected properties of have the same value as the equally named + properties of . - - The maximum allowed duration. - + + Property values are considered equal if, after converting them to the requested type, calling + returns true. + - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. - - Zero or more values to use for filling in any compatible placeholders. + + Zero or more objects to format using the placeholders in . - + - Asserts that the execution time of the operation does not exceed a specified amount of time. + Gets the object which value is being asserted. - - The maximum allowed duration. - - + - Provides methods for asserting that the execution time of an object member satifies certain conditions. + Is responsible for validating the equality of one or more properties of a subject with another object. - @@ -1251,15 +2193,112 @@ - Case insensitive comparison + Asserts that a string is exactly the same as another string, including any leading or trailing whitespace, with + the exception of the casing. + + The string that the subject is expected to be equivalent to. + - Asserts that a string is exactly the same as another string, including the casing and any leading or trailing whitespace. + Asserts that a string is exactly the same as another string, including any leading or trailing whitespace, with + the exception of the casing. - The expected string. + The string that the subject is expected to be equivalent to. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that a string matches a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + + + Asserts that a string matches a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that a string does not match a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + + + Asserts that a string does not match a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that a string matches a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + + + Asserts that a string matches a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + A formatted phrase as is supported by explaining why the assertion + is needed. If the phrase does not start with the word because, it is prepended automatically. + + + Zero or more objects to format using the placeholders in . + + + + + Asserts that a string does not match a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. + + + + + Asserts that a string does not match a wildcard pattern. + + + The wildcard pattern with which the subject is matched, where * and ? have special meanings. A formatted phrase as is supported by explaining why the assertion @@ -1328,7 +2367,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1345,7 +2384,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1362,7 +2401,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1379,7 +2418,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1388,128 +2427,158 @@ Gets the object which value is being asserted. - + - Asserts that a value is within a range. + Dedicated class for comparing two strings and generating consistent error messages. - - Where the range is continuous or incremental depends on the actual type of the value. - - - The minimum valid value of the range. + + + + Gets or sets a value indicating whether the subject should not match the pattern. + + + + + Gets or sets a value indicating whether the matching process should ignore any casing difference. + + + + + Provides methods for asserting that two objects differ in certain ways. + + + + + Asserts that a occurs a specified amount of time before another . + + + The to compare the subject with. - - The maximum valid value of the range. + + + + Asserts that a occurs a specified amount of time before another . + + + The to compare the subject with. + + + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. + + + Zero or more values to use for filling in any compatible placeholders. - + - Asserts that a value is within a range. + Asserts that a occurs a specified amount of time after another . - - Where the range is continuous or incremental depends on the actual type of the value. - - - The minimum valid value of the range. + + The to compare the subject with. - - The maximum valid value of the range. + + + + Asserts that a occurs a specified amount of time after another . + + + The to compare the subject with. - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. + A formatted phrase explaining why the assertion should be satisfied. If the phrase does not + start with the word because, it is prepended to the message. - Zero or more objects to format using the placeholders in . + Zero or more values to use for filling in any compatible placeholders. - + - Determines whether this instance can handle the specified value. + Provides the logic and the display text for a . - The value. - - true if this instance can handle the specified value; otherwise, false. - - + - Returns a that represents this instance. + Returns a based on a number of milliseconds. - The value. - - A that represents this instance. - - + - This class is used to store data about an intercepted event + Returns a based on a number of seconds. - + - Default constructor stores the parameters the event was raised with + Returns a based on a number of minutes. - + - Parameters for the event + Returns a based on a number of hours. - + - Provides methods for asserting that two objects differ in certain ways. + Returns a based on a number of days. - + - Asserts that a occurs a specified amount of time before another . + Finds the first index at which the does not match the + string anymore, including the exact casing. + + + + + Finds the first index at which the does not match the + string anymore, accounting for the specified . + + + + + Gets the quoted three characters at the specified index of a string, including the index itself. + + + + + Replaces all characters that might conflict with formatting placeholders and newlines with their escaped counterparts. + + + + + Static methods that aid in generic event subscription + + + + + Generates an eventhandler for an event of type eventSignature that calls RegisterEvent on recorder + when invoked. + + + + + Finds the Return Type of a Delegate. - - The to compare the subject with. - - + - Asserts that a occurs a specified amount of time before another . + Returns an Array of Types that make up a delegate's parameter signature. - - The to compare the subject with. - - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. - - + - Asserts that a occurs a specified amount of time after another . + Returns an array of types appended with an EventRecorder reference at the beginning. - - The to compare the subject with. - - + - Asserts that a occurs a specified amount of time after another . + Returns T/F Dependent on a Type Being a Delegate. - - The to compare the subject with. - - - A formatted phrase explaining why the assertion should be satisfied. If the phrase does not - start with the word because, it is prepended to the message. - - - Zero or more values to use for filling in any compatible placeholders. - - + - Provides the logic and the display text for a . + Returns the MethodInfo for the Delegate's "Invoke" Method. @@ -1546,7 +2615,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1577,7 +2646,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1602,7 +2671,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1627,7 +2696,7 @@ A formatted phrase explaining why the assertion should be satisfied. If the phrase does not start with the word because, it is prepended to the message. - + Zero or more values to use for filling in any compatible placeholders. @@ -1645,14 +2714,62 @@ Asserts that at least one occurrence of the event had an object matching a predicate. - + + + Records activity for a single event. + + + + + Records raised events for one event on one object + + + + + Store information about a raised event + + Parameters the event was raised with + + + + The object events are recorded from + + + + + The name of the event that's recorded + + + + + + The object events are recorded from + The name of the event that's recorded + + + + Enumerate raised events + + + + + Enumerate raised events + + + + + + Called by the auto-generated IL, to record information about a raised event. + + + - Dedicated class for comparing two strings and generating consistent error messages. + The object events are recorded from - + - Gets or sets a value indicating whether the comparison is case sensitive. + The name of the event that's recorded @@ -1661,61 +2778,171 @@ This should ensure the Garbage Collector can still clean-up the event source object. - + - Finds the first index at which the does not match the - string anymore, including the exact casing. + This class is used to store data about an intercepted event - + - Finds the first index at which the does not match the - string anymore, accounting for the specified . + Default constructor stores the parameters the event was raised with - + - Gets the quoted three characters at the specified index of a string, including the index itself. + Parameters for the event - + - Replaces all characters that might conflict with formatting placeholders and newlines with their escaped counterparts. + Helper class for verifying a condition and/or throwing a test harness specific exception representing an assertion failure. - + - Asserts that a nullable numeric value is not null. + Asserts that the supplied is met. + + The condition to assert. + + The message that will be used in the exception. This should describe what was expected and why. This message + can contain the following three placeholders:
+ + {0} = the expected value + {1} = the actual value + {2} = a reason explaining the expectations +
+ + + The expected value, or null if there is no explicit expected value. + + The actual value, or null if there is no explicit actual value. + Should describe the reason for the expectation. + Optional args for formatting placeholders in the . +
+ + + Asserts that the supplied is met. + The condition to assert. + + The message that will be used in the exception. This should describe what was expected and why. This message + can contain the following three placeholders:
+ + {0} = the expected value + {1} = the actual value + {2} = a reason explaining the expectations +
+ + + The expected value, or null if there is no explicit expected value. + + The actual value, or null if there is no explicit actual value. + Should describe the reason for the expectation. + Optional args for formatting placeholders in the .
- + - Asserts that a nullable numeric value is not null. + Handles an assertion failure. - - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. + + The message that will be used in the exception. This should describe what was expected and why. This message + can contain the following three placeholders:
+ + {0} = the expected value + {1} = the actual value + {2} = a reason explaining the expectations +
+ Any additional placeholders are allowed and will be satisfied using the . + + + The expected value, or null if there is no explicit expected value. + + The actual value, or null if there is no explicit actual value. + Should describe the reason for the expectation. + Optional args for formatting placeholders in the . + + Optional arguments to satisfy any additional placeholders in the - - Zero or more objects to format using the placeholders in . -
- + - Asserts that a nullable numeric value is null. + Gets an object that wraps and executes a conditional or unconditional verification. - + - Asserts that a nullable numeric value is null. + Determines whether this instance can handle the specified value. + + The value. + + true if this instance can handle the specified value; otherwise, false. + + + + + Returns a that represents this instance. + + The value. + + A that represents this instance. + + + + + Provides services for formatting an object being used in an assertion in a human readable format. + + + + + A list of objects responsible for formatting the objects represented by placeholders. + + + + + Returns a human-readable representation of a particular object. + + + + + Returns a human-readable representation of a particular object that starts on a new line. + + + + + Provides a fluent API for verifying an arbitrary condition. + + + + + Initializes a new instance of the class. + + + + + Gets the name or identifier of the current subject, or a default value if the subject is not known. + + + + + Define the failure message for the verification. + + + If the contains the text "{reason}", this will be replaced by the reason as + defined through . Only 10 are supported in combination with + a {reason}. + + The format string that represents the failure message. + Optional arguments for the + + + + Indicates that every argument passed into is displayed on a separate line. + + + + + Gets or sets the name of the subject for the next verification. - - A formatted phrase as is supported by explaining why the assertion - is needed. If the phrase does not start with the word because, it is prepended automatically. - - - Zero or more objects to format using the placeholders in . -
diff --git a/NzbDrone.Core.Test/CentralDispatchTest.cs b/NzbDrone.Core.Test/CentralDispatchTest.cs new file mode 100644 index 000000000..3df09023d --- /dev/null +++ b/NzbDrone.Core.Test/CentralDispatchTest.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Core.Providers; +using NzbDrone.Core.Providers.Indexer; +using NzbDrone.Core.Providers.Jobs; +using NzbDrone.Core.Test.Framework; +using Ninject; + +namespace NzbDrone.Core.Test +{ + [TestFixture] + // ReSharper disable InconsistentNaming + class CentralDispatchTest : TestBase + { + readonly IList indexers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(IndexerBase))).ToList(); + readonly IList jobs = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IJob))).ToList(); + + + [Test] + public void InitAppTest() + { + CentralDispatch.NinjectKernel.Should().NotBeNull(); + } + + [Test] + public void Resolve_all_providers() + { + var providers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.Name.EndsWith("Provider")).ToList(); + + providers.Should().NotBeEmpty(); + + foreach (var provider in providers) + { + Console.WriteLine("Resolving " + provider.Name); + CentralDispatch.NinjectKernel.Get(provider).Should().NotBeNull(); + } + } + + + [Test] + public void All_jobs_should_be_registered() + { + //Assert + + var registeredJobs = CentralDispatch.NinjectKernel.GetAll(); + + jobs.Should().NotBeEmpty(); + + registeredJobs.Should().HaveSameCount(jobs); + } + + + [Test] + public void All_indexers_should_be_registered() + { + //Assert + + var registeredIndexers = CentralDispatch.NinjectKernel.GetAll(); + + indexers.Should().NotBeEmpty(); + + registeredIndexers.Should().HaveSameCount(indexers); + } + + + [Test] + public void jobs_are_initialized() + { + CentralDispatch.NinjectKernel.Get().All().Should().HaveSameCount(jobs); + } + + [Test] + public void indexers_are_initialized() + { + CentralDispatch.NinjectKernel.Get().All().Should().HaveSameCount(indexers); + } + + [Test] + public void quality_profile_initialized() + { + CentralDispatch.NinjectKernel.Get().All().Should().HaveCount(2); + } + + [Test] + public void get_version() + { + CentralDispatch.Version.Should().NotBeNull(); + } + } +} diff --git a/NzbDrone.Core.Test/Framework/Fixtures.cs b/NzbDrone.Core.Test/Framework/Fixtures.cs index 156fa50c2..4d16f35ba 100644 --- a/NzbDrone.Core.Test/Framework/Fixtures.cs +++ b/NzbDrone.Core.Test/Framework/Fixtures.cs @@ -13,15 +13,7 @@ namespace NzbDrone.Core.Test [TearDown] public void TearDown() { - var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories); - foreach (var file in filesToDelete) - { - try - { - File.Delete(file); - } - catch{} - } + } [SetUp] @@ -42,6 +34,17 @@ namespace NzbDrone.Core.Test { Console.WriteLine("Unable to configure logging. " + e); } + + + var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories); + foreach (var file in filesToDelete) + { + try + { + File.Delete(file); + } + catch { } + } } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/Framework/MockLib.cs b/NzbDrone.Core.Test/Framework/MockLib.cs index a68f47568..9cf224e7f 100644 --- a/NzbDrone.Core.Test/Framework/MockLib.cs +++ b/NzbDrone.Core.Test/Framework/MockLib.cs @@ -39,32 +39,7 @@ namespace NzbDrone.Core.Test.Framework return database; } - public static DiskProvider GetStandardDisk(int seasons, int episodes) - { - var mock = new Mock(); - mock.Setup(c => c.GetDirectories(It.IsAny())).Returns(StandardSeries); - mock.Setup(c => c.FolderExists(It.Is(d => StandardSeries.Contains(d)))).Returns(true); - - - foreach (var series in StandardSeries) - { - var file = new List(); - for (int s = 0; s < seasons; s++) - { - for (int e = 0; e < episodes; e++) - { - file.Add(String.Format("{0}\\Seasons {1}\\myepname.S{1:00}E{2:00}.avi", series, s, e)); - } - } - - string series1 = series; - mock.Setup(c => c.GetFiles(series1, "*.avi", SearchOption.AllDirectories)).Returns(file.ToArray()); - } - - return mock.Object; - } - - public static Series GetFakeSeries(int id, string title) + public static Series GetFakeSeries(int id, string title) { return Builder.CreateNew() .With(c => c.SeriesId = id) diff --git a/NzbDrone.Core.Test/Framework/TestBase.cs b/NzbDrone.Core.Test/Framework/TestBase.cs index 53f2c57b6..900d071a5 100644 --- a/NzbDrone.Core.Test/Framework/TestBase.cs +++ b/NzbDrone.Core.Test/Framework/TestBase.cs @@ -10,6 +10,8 @@ namespace NzbDrone.Core.Test.Framework public void Setup() { ExceptionVerification.Reset(); + + } [TearDown] diff --git a/NzbDrone.Core.Test/IndexerProviderTest.cs b/NzbDrone.Core.Test/IndexerProviderTest.cs index c6e0cdf59..a586ab5f7 100644 --- a/NzbDrone.Core.Test/IndexerProviderTest.cs +++ b/NzbDrone.Core.Test/IndexerProviderTest.cs @@ -33,10 +33,10 @@ namespace NzbDrone.Core.Test indexerProvider.SaveSettings(settings); //Assert - indexerProvider.GetAllISettings(); + indexerProvider.All(); - indexerProvider.GetAllISettings().Should().HaveCount(1); + indexerProvider.All().Should().HaveCount(1); indexerProvider.GetEnabledIndexers().Should().HaveCount(1); } @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Test //Assert - indexerProvider.GetAllISettings().Should().HaveCount(1); + indexerProvider.All().Should().HaveCount(1); indexerProvider.GetEnabledIndexers().Should().BeEmpty(); } } diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index 92448807c..5392c6e96 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test .Setup(h => h.DownloadStream(It.IsAny(), It.IsAny())) .Returns(File.OpenRead(".\\Files\\Rss\\" + fileName)); - var fakeSettings = Builder.CreateNew().Build(); + var fakeSettings = Builder.CreateNew().Build(); mocker.GetMock() .Setup(c => c.GetSettings(It.IsAny())) .Returns(fakeSettings); @@ -62,7 +62,7 @@ namespace NzbDrone.Core.Test { var mocker = new AutoMoqer(); mocker.Resolve(); - var fakeSettings = Builder.CreateNew().Build(); + var fakeSettings = Builder.CreateNew().Build(); mocker.GetMock() .Setup(c => c.GetSettings(It.IsAny())) .Returns(fakeSettings); @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Test const string summary = "My fake summary"; - var fakeSettings = Builder.CreateNew().Build(); + var fakeSettings = Builder.CreateNew().Build(); mocker.GetMock() .Setup(c => c.GetSettings(It.IsAny())) .Returns(fakeSettings); @@ -127,7 +127,7 @@ namespace NzbDrone.Core.Test const string summary = "My fake summary"; - var fakeSettings = Builder.CreateNew().Build(); + var fakeSettings = Builder.CreateNew().Build(); mocker.GetMock() .Setup(c => c.GetSettings(It.IsAny())) .Returns(fakeSettings); @@ -150,7 +150,7 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); mocker.SetConstant(new HttpProvider()); - var fakeSettings = Builder.CreateNew().Build(); + var fakeSettings = Builder.CreateNew().Build(); mocker.GetMock() .Setup(c => c.GetSettings(It.IsAny())) .Returns(fakeSettings); diff --git a/NzbDrone.Core.Test/LogProviderTest.cs b/NzbDrone.Core.Test/LogProviderTest.cs index 4ee5a2091..ec147eab1 100644 --- a/NzbDrone.Core.Test/LogProviderTest.cs +++ b/NzbDrone.Core.Test/LogProviderTest.cs @@ -50,6 +50,38 @@ namespace NzbDrone.Core.Test Assert.AreEqual("write_log", logItem.Method); } + [Test] + public void write_long_log() + { + //setup + var message = String.Empty; + for (int i = 0; i < 100; i++) + { + message += Guid.NewGuid(); + } + + var db = MockLib.GetEmptyDatabase(true); + + var sonicTarget = new DatabaseTarget(db); + + LogManager.Configuration.AddTarget("DbLogger", sonicTarget); + LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, sonicTarget)); + LogManager.Configuration.Reload(); + + Logger Logger = LogManager.GetCurrentClassLogger(); + //Act + + Logger.Info(message); + + //Assert + db.Fetch().Should().HaveCount(1); + + var logItem = db.Fetch().First(); + + logItem.Message.Should().HaveLength(message.Length); + Assert.AreEqual(message, logItem.Message); + } + [Test] public void clearLog() diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index f0f799f33..979e423c0 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -146,7 +146,7 @@ namespace NzbDrone.Core.Test .Build(); var mocker = new AutoMoqer(); - mocker.GetMock().Setup(e => e.SeasonFolderFormat).Returns(seasonFolderFormat); + mocker.GetMock().Setup(e => e.SortingSeasonFolderFormat).Returns(seasonFolderFormat); //Act var result = mocker.Resolve().CalculateFilePath(fakeSeries, 1, filename, ".mkv"); diff --git a/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs b/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs index 6ec6da471..037e32ea5 100644 --- a/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs +++ b/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs @@ -22,12 +22,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -49,12 +49,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -76,12 +76,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(1); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -103,12 +103,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() @@ -131,12 +131,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -158,12 +158,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -185,12 +185,12 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() @@ -213,13 +213,13 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -247,13 +247,13 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -281,13 +281,13 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -315,13 +315,13 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(1); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -349,13 +349,13 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(0); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -383,13 +383,13 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index eb2beb327..79ab4658d 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -56,6 +56,9 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll + + ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll + False ..\Libraries\NLog.dll @@ -86,6 +89,7 @@ + diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 4bdbc7d1a..d7073507a 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Test [TestCase(@"z:\tv shows\robot chicken\Specials\S00E16 - Dear Consumer - SD TV.avi", 0, 16)] [TestCase(@"D:\shares\TV Shows\Parks And Recreation\Season 2\S02E21 - 94 Meetings - 720p TV.mkv", 2, 21)] [TestCase(@"D:\shares\TV Shows\Battlestar Galactica (2003)\Season 2\S02E21.avi", 2, 21)] - [TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", "Chuck", 4, 5)] + [TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", 4, 5)] public void PathParse_tests(string path, int season, int episode) { var result = Parser.ParsePath(path); @@ -125,7 +125,7 @@ namespace NzbDrone.Core.Test result.QualityType.Should().Be(qualityEnum); } } - + [Timeout(1000)] [TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", "WEEDS", 3, new[] { 1, 2, 3, 4, 5, 6 }, 6)] [TestCase("Two.and.a.Half.Men.103.104.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Men", 1, new[] { 3, 4 }, 2)] @@ -148,7 +148,7 @@ namespace NzbDrone.Core.Test result.EpisodeNumbers.Count.Should().Be(count); } - + [TestCase("Conan 2011 04 18 Emma Roberts HDTV XviD BFF", "Conan", 2011, 04, 18)] [TestCase("The Tonight Show With Jay Leno 2011 04 15 1080i HDTV DD5 1 MPEG2 TrollHD", "The Tonight Show With Jay Leno", 2011, 04, 15)] [TestCase("The.Daily.Show.2010.10.11.Johnny.Knoxville.iTouch-MW", "The.Daily.Show", 2010, 10, 11)] @@ -165,7 +165,7 @@ namespace NzbDrone.Core.Test Assert.IsNull(result.EpisodeNumbers); } - + [TestCase("30.Rock.Season.04.HDTV.XviD-DIMENSION", "30.Rock", 4)] [TestCase("Parks.and.Recreation.S02.720p.x264-DIMENSION", "Parks.and.Recreation", 2)] [TestCase("The.Office.US.S03.720p.x264-DIMENSION", "The.Office.US", 3)] @@ -176,7 +176,7 @@ namespace NzbDrone.Core.Test result.CleanTitle.Should().Be(Parser.NormalizeTitle(title)); result.EpisodeNumbers.Count.Should().Be(0); } - + [TestCase("Conan", "conan")] [TestCase("The Tonight Show With Jay Leno", "tonightshowwithjayleno")] [TestCase("The.Daily.Show", "dailyshow")] @@ -198,7 +198,7 @@ namespace NzbDrone.Core.Test var result = Parser.NormalizePath(dirty); result.Should().Be(clean); } - + [TestCase("CaPitAl", "capital")] [TestCase("peri.od", "period")] [TestCase("this.^&%^**$%@#$!That", "thisthat")] @@ -209,7 +209,7 @@ namespace NzbDrone.Core.Test result.Should().Be(clean); } - + [TestCase("the")] [TestCase("and")] [TestCase("or")] diff --git a/NzbDrone.Core.Test/QualityProfileTest.cs b/NzbDrone.Core.Test/QualityProfileTest.cs index af617b935..b1973c7c0 100644 --- a/NzbDrone.Core.Test/QualityProfileTest.cs +++ b/NzbDrone.Core.Test/QualityProfileTest.cs @@ -1,6 +1,7 @@ // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; +using System.Linq; using AutoMoq; using FizzWare.NBuilder; using FluentAssertions; @@ -16,9 +17,6 @@ namespace NzbDrone.Core.Test // ReSharper disable InconsistentNaming public class QualityProfileTest : TestBase { - /// - /// Test_s the storage. - /// [Test] public void Test_Storage() { @@ -73,7 +71,7 @@ namespace NzbDrone.Core.Test var mocker = new AutoMoqer(); var db = MockLib.GetEmptyDatabase(); mocker.SetConstant(db); - + var testProfile = new QualityProfile { Name = Guid.NewGuid().ToString(), @@ -95,7 +93,7 @@ namespace NzbDrone.Core.Test updated.Name.Should().Be(currentProfile.Name); updated.Cutoff.Should().Be(QualityTypes.Bluray720p); updated.AllowedString.Should().Be(currentProfile.AllowedString); - + } [Test] @@ -127,5 +125,47 @@ namespace NzbDrone.Core.Test Assert.AreEqual(profileId, result[0].QualityProfileId); Assert.AreEqual(testProfile.Name, profile.Name); } + + + [Test] + public void SetupInitial_should_add_two_profiles() + { + var mocker = new AutoMoqer(); + var db = MockLib.GetEmptyDatabase(); + mocker.SetConstant(db); + + //Act + mocker.Resolve().SetupDefaultProfiles(); + + //Assert + var profiles = mocker.Resolve().All(); + + + profiles.Should().HaveCount(2); + profiles.Should().Contain(e => e.Name == "HD"); + profiles.Should().Contain(e => e.Name == "SD"); + + } + + [Test] + //This confirms that new profiles are added only if no other profiles exists. + //We don't want to keep adding them back if a user deleted them on purpose. + public void SetupInitial_should_skip_if_any_profile_exists() + { + var mocker = new AutoMoqer(); + var db = MockLib.GetEmptyDatabase(); + mocker.SetConstant(db); + var fakeProfile = Builder.CreateNew().Build(); + + //Act + mocker.Resolve().Add(fakeProfile); + mocker.Resolve().SetupDefaultProfiles(); + + //Assert + var profiles = mocker.Resolve().All(); + + + profiles.Should().HaveCount(1); + } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/QualityTest.cs b/NzbDrone.Core.Test/QualityTest.cs index 42743d1c1..03c2f9af0 100644 --- a/NzbDrone.Core.Test/QualityTest.cs +++ b/NzbDrone.Core.Test/QualityTest.cs @@ -11,43 +11,39 @@ namespace NzbDrone.Core.Test public class QualityTest : TestBase { [Test] - [Ignore("No supported asserts are available")] public void Icomparer_greater_test() { var first = new Quality(QualityTypes.DVD, true); var second = new Quality(QualityTypes.Bluray1080p, true); - //Assert.GreaterThan(second, first); + second.Should().BeGreaterThan(first); } [Test] - [Ignore("No supported asserts are available")] public void Icomparer_greater_proper() { var first = new Quality(QualityTypes.Bluray1080p, false); var second = new Quality(QualityTypes.Bluray1080p, true); - //Assert.GreaterThan(second, first); + second.Should().BeGreaterThan(first); } [Test] - [Ignore("No supported asserts are available")] public void Icomparer_lesser() { var first = new Quality(QualityTypes.DVD, true); var second = new Quality(QualityTypes.Bluray1080p, true); - //Assert.LessThan(first, second); + first.Should().BeLessThan(second); } [Test] - [Ignore("No supported asserts are available")] public void Icomparer_lesser_proper() { var first = new Quality(QualityTypes.DVD, false); var second = new Quality(QualityTypes.DVD, true); - //Assert.LessThan(first, second); + first.Should().BeLessThan(second); } [Test] @@ -86,7 +82,7 @@ namespace NzbDrone.Core.Test var first = new Quality(QualityTypes.Bluray1080p, true); var second = new Quality(QualityTypes.Bluray1080p, true); - Assert.IsFalse(first != second); + (first != second).Should().BeFalse(); } [Test] diff --git a/NzbDrone.Core.Test/packages.config b/NzbDrone.Core.Test/packages.config index 9e1b92dfa..fe6b20152 100644 --- a/NzbDrone.Core.Test/packages.config +++ b/NzbDrone.Core.Test/packages.config @@ -7,4 +7,5 @@ + \ No newline at end of file diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index b312bf5e7..6d9f15f4b 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; using System.Web.Hosting; using Ninject; using NLog; @@ -21,6 +22,12 @@ namespace NzbDrone.Core private static readonly Object KernelLock = new object(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + + public static Version Version + { + get { return Assembly.GetExecutingAssembly().GetName().Version; } + } + public static String AppPath { get @@ -45,7 +52,7 @@ namespace NzbDrone.Core } } - private static void InitializeApp() + public static void InitializeApp() { BindKernel(); @@ -60,7 +67,7 @@ namespace NzbDrone.Core BindExternalNotifications(); } - public static void BindKernel() + private static void BindKernel() { lock (KernelLock) { diff --git a/NzbDrone.Core/Datastore/MigrationLogger.cs b/NzbDrone.Core/Datastore/MigrationLogger.cs index f9adaa38e..84ceb5fd3 100644 --- a/NzbDrone.Core/Datastore/MigrationLogger.cs +++ b/NzbDrone.Core/Datastore/MigrationLogger.cs @@ -67,7 +67,7 @@ namespace NzbDrone.Core.Datastore public void Trace(string format, params object[] args) { - Logger.Trace(format, args); + //Logger.Trace(format, args); } } } \ No newline at end of file diff --git a/NzbDrone.Core/Datastore/Migrations/Migration20110622.cs b/NzbDrone.Core/Datastore/Migrations/Migration20110707.cs similarity index 95% rename from NzbDrone.Core/Datastore/Migrations/Migration20110622.cs rename to NzbDrone.Core/Datastore/Migrations/Migration20110707.cs index bb509ce00..9566a0d55 100644 --- a/NzbDrone.Core/Datastore/Migrations/Migration20110622.cs +++ b/NzbDrone.Core/Datastore/Migrations/Migration20110707.cs @@ -5,8 +5,8 @@ using Migrator.Framework; namespace NzbDrone.Core.Datastore.Migrations { - [Migration(20110622)] - public class Migration20110622 : Migration + [Migration(20110707)] + public class Migration20110707 : Migration { public override void Up() { @@ -16,11 +16,11 @@ namespace NzbDrone.Core.Datastore.Migrations new Column("Title", DbType.String, ColumnProperty.Null), new Column("CleanTitle", DbType.String, ColumnProperty.Null), new Column("Status", DbType.String, ColumnProperty.Null), - new Column("Overview", DbType.String, ColumnProperty.Null), + new Column("Overview", DbType.String,4000, ColumnProperty.Null), new Column("AirsDayOfWeek", DbType.Int32, ColumnProperty.Null), new Column("AirTimes", DbType.String, ColumnProperty.Null), new Column("Language", DbType.String, ColumnProperty.Null), - new Column("Path", DbType.String, ColumnProperty.NotNull), + new Column("Path", DbType.String,4000, ColumnProperty.NotNull), new Column("Monitored", DbType.Boolean, ColumnProperty.NotNull), new Column("QualityProfileId", DbType.Int32, ColumnProperty.NotNull), new Column("SeasonFolder", DbType.Boolean, ColumnProperty.NotNull), @@ -35,8 +35,8 @@ namespace NzbDrone.Core.Datastore.Migrations new Column("SeriesId", DbType.Int32, ColumnProperty.NotNull), new Column("SeasonNumber", DbType.Int32, ColumnProperty.NotNull), new Column("EpisodeNumber", DbType.Int32, ColumnProperty.NotNull), - new Column("Title", DbType.String, ColumnProperty.Null), - new Column("Overview", DbType.String, ColumnProperty.Null), + new Column("Title", DbType.String,100, ColumnProperty.Null), + new Column("Overview", DbType.String,4000, ColumnProperty.Null), new Column("Ignored", DbType.Boolean, ColumnProperty.NotNull), new Column("EpisodeFileId", DbType.Int32, ColumnProperty.Null), new Column("AirDate", DbType.DateTime, ColumnProperty.Null), @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Datastore.Migrations new Column("EpisodeFileId", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), new Column("SeriesId", DbType.Int32, ColumnProperty.NotNull), - new Column("Path", DbType.String, ColumnProperty.NotNull), + new Column("Path", DbType.String,4000, ColumnProperty.NotNull), new Column("Quality", DbType.Int32, ColumnProperty.NotNull), new Column("Proper", DbType.Int32, ColumnProperty.NotNull), new Column("Size", DbType.Int64, ColumnProperty.NotNull), @@ -107,7 +107,7 @@ namespace NzbDrone.Core.Datastore.Migrations Database.AddTable("RootDirs", new[] { new Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), - new Column("Path", DbType.String, ColumnProperty.NotNull) + new Column("Path", DbType.String, 4000, ColumnProperty.NotNull) }); Database.AddTable("ExternalNotificationSettings", new[] @@ -118,7 +118,7 @@ namespace NzbDrone.Core.Datastore.Migrations new Column("Name", DbType.String, ColumnProperty.NotNull) }); - Database.AddTable("JobSettings", new[] + Database.AddTable("JobDefinitions", new[] { new Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), new Column("Enable", DbType.Boolean, ColumnProperty.NotNull), @@ -140,16 +140,16 @@ namespace NzbDrone.Core.Datastore.Migrations Database.AddTable("Logs", new[] { new Column("LogId", DbType.Int64, ColumnProperty.PrimaryKeyWithIdentity), - new Column("Message", DbType.String, ColumnProperty.NotNull), + new Column("Message", DbType.String,4000, ColumnProperty.NotNull), new Column("Time", DbType.DateTime, ColumnProperty.NotNull), new Column("Logger", DbType.String, ColumnProperty.NotNull), new Column("Method", DbType.String, ColumnProperty.NotNull), - new Column("Exception", DbType.String, ColumnProperty.Null), + new Column("Exception", DbType.String,4000, ColumnProperty.Null), new Column("ExceptionType", DbType.String, ColumnProperty.Null), new Column("Level", DbType.String, ColumnProperty.NotNull) }); - Database.AddTable("IndexerSettings", new[] + Database.AddTable("IndexerDefinitions", new[] { new Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), new Column("Enable", DbType.Boolean, ColumnProperty.NotNull), diff --git a/NzbDrone.Core/Datastore/MigrationsHelper.cs b/NzbDrone.Core/Datastore/MigrationsHelper.cs index fa4e55986..b5b74ab8e 100644 --- a/NzbDrone.Core/Datastore/MigrationsHelper.cs +++ b/NzbDrone.Core/Datastore/MigrationsHelper.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Datastore EnsureDatabase(connetionString); - Logger.Info("Preparing run database migration"); + Logger.Info("Preparing to run database migration"); try { @@ -46,7 +46,7 @@ namespace NzbDrone.Core.Datastore } catch (Exception e) { - Logger.FatalException("An error has occured while migrating database", e); + Logger.FatalException("An error has occurred while migrating database", e); } } diff --git a/NzbDrone.Core/Datastore/SqliteProvider.cs b/NzbDrone.Core/Datastore/SqliteProvider.cs deleted file mode 100644 index 1fbe6cf9d..000000000 --- a/NzbDrone.Core/Datastore/SqliteProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using Migrator.Framework; -using Migrator.Providers.SQLite; - -namespace NzbDrone.Core.Datastore -{ - class SqliteProvider - { - private readonly ITransformationProvider _dataBase; - - public SqliteProvider(string connectionString) - { - _dataBase = new SQLiteTransformationProvider(new SQLiteDialect(), connectionString); - } - - - public int GetPageSize() - { - return Convert.ToInt32(_dataBase.ExecuteScalar("PRAGMA cache_size")); - } - - - - } -} diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 77f707a84..31072b292 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -138,9 +138,9 @@ False ..\Libraries\Migrator.NET\Migrator.Providers.dll - + False - ..\packages\MiniProfiler.1.3\lib\MvcMiniProfiler.dll + ..\packages\MiniProfiler.1.4\lib\MvcMiniProfiler.dll ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll @@ -176,8 +176,7 @@ - - + @@ -226,8 +225,8 @@ - - + + diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 7780fefb9..997010ae3 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -136,7 +136,7 @@ namespace NzbDrone.Core return parsedEpisode; } } - Logger.Warn("Unable to parse text into episode info. {0}", title); + Logger.Warn("Unable to parse episode info. {0}", title); return null; } diff --git a/NzbDrone.Core/Properties/AssemblyInfo.cs b/NzbDrone.Core/Properties/AssemblyInfo.cs index d6e8b0bfe..77251d559 100644 --- a/NzbDrone.Core/Properties/AssemblyInfo.cs +++ b/NzbDrone.Core/Properties/AssemblyInfo.cs @@ -50,5 +50,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.0.*")] +[assembly: AssemblyVersion("0.5.0.*")] [assembly: InternalsVisibleTo("NzbDrone.Core.Test")] \ No newline at end of file diff --git a/NzbDrone.Core/Providers/Core/ConfigProvider.cs b/NzbDrone.Core/Providers/Core/ConfigProvider.cs index 5ee924b76..f34b6cc0b 100644 --- a/NzbDrone.Core/Providers/Core/ConfigProvider.cs +++ b/NzbDrone.Core/Providers/Core/ConfigProvider.cs @@ -190,25 +190,25 @@ namespace NzbDrone.Core.Providers.Core set { SetValue("BlackholeDirectory", value); } } - public virtual bool SeriesName + public virtual bool SortingIncludeSeriesName { get { return GetValueBoolean("Sorting_SeriesName", true); } set { SetValue("Sorting_SeriesName", value); } } - public virtual bool EpisodeName + public virtual bool SortingIncludeEpisodeTitle { get { return GetValueBoolean("Sorting_EpisodeName", true); } set { SetValue("Sorting_EpisodeName", value); } } - public virtual bool ReplaceSpaces + public virtual bool SortingReplaceSpaces { - get { return GetValueBoolean("Sorting_ReplaceSpaces", true); } + get { return GetValueBoolean("Sorting_ReplaceSpaces"); } set { SetValue("Sorting_ReplaceSpaces", value); } } - public virtual bool AppendQuality + public virtual bool SortingAppendQuality { get { return GetValueBoolean("Sorting_AppendQaulity", true); } set { SetValue("Sorting_AppendQaulity", value); } @@ -216,30 +216,30 @@ namespace NzbDrone.Core.Providers.Core public virtual bool UseSeasonFolder { - get { return GetValueBoolean("Sorting_SeasonFolder", true); } + get { return GetValueBoolean("UseSeasonFolder", true); } - set { SetValue("Sorting_SeasonFolder", value); } + set { SetValue("UseSeasonFolder", value); } } - public virtual string SeasonFolderFormat + public virtual string SortingSeasonFolderFormat { get { return GetValue("Sorting_SeasonFolderFormat", "Season %s"); } set { SetValue("Sorting_SeasonFolderFormat", value); } } - public virtual int SeparatorStyle + public virtual int SortingSeparatorStyle { get { return GetValueInt("Sorting_SeparatorStyle"); } set { SetValue("Sorting_SeparatorStyle", value); } } - public virtual int NumberStyle + public virtual int SortingNumberStyle { get { return GetValueInt("Sorting_NumberStyle", 2); } set { SetValue("Sorting_NumberStyle", value); } } - public virtual int MultiEpisodeStyle + public virtual int SortingMultiEpisodeStyle { get { return GetValueInt("Sorting_MultiEpisodeStyle"); } set { SetValue("Sorting_MultiEpisodeStyle", value); } diff --git a/NzbDrone.Core/Providers/Core/DiskProvider.cs b/NzbDrone.Core/Providers/Core/DiskProvider.cs index 8e8ae2cb0..3a22a4328 100644 --- a/NzbDrone.Core/Providers/Core/DiskProvider.cs +++ b/NzbDrone.Core/Providers/Core/DiskProvider.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Collections.Generic; using System.IO; @@ -21,9 +22,14 @@ namespace NzbDrone.Core.Providers.Core return Directory.GetDirectories(path); } - public virtual string[] GetFiles(string path, string pattern, SearchOption searchOption) + public virtual string[] GetFiles(string path, SearchOption searchOption) { - return Directory.GetFiles(path, pattern, searchOption); + return Directory.GetFiles(path, "*.*", searchOption); + } + + public virtual long GetDirectorySize(string path) + { + return GetFiles(path, SearchOption.AllDirectories).Sum(e => new FileInfo(e).Length); } public virtual long GetSize(string path) diff --git a/NzbDrone.Core/Providers/DiskScanProvider.cs b/NzbDrone.Core/Providers/DiskScanProvider.cs index 456d7349e..9451dc5d2 100644 --- a/NzbDrone.Core/Providers/DiskScanProvider.cs +++ b/NzbDrone.Core/Providers/DiskScanProvider.cs @@ -135,7 +135,7 @@ namespace NzbDrone.Core.Providers { ep.EpisodeFileId = fileId; _episodeProvider.UpdateEpisode(ep); - Logger.Debug("Linking file {0} to {1}", filePath, ep); + Logger.Debug("Linking [{0}] > [{1}]", filePath, ep); } @@ -156,7 +156,7 @@ namespace NzbDrone.Core.Providers _diskProvider.CreateDirectory(newFile.DirectoryName); //Do the rename - Logger.Debug("Moving file [{0}] > [{1}]", episodeFile.Path, newFile.FullName); + Logger.Debug("Moving [{0}] > [{1}]", episodeFile.Path, newFile.FullName); _diskProvider.MoveFile(episodeFile.Path, newFile.FullName); //Update the filename in the DB @@ -176,7 +176,7 @@ namespace NzbDrone.Core.Providers { if (!_diskProvider.FileExists(episodeFile.Path)) { - Logger.Trace("File {0} no longer exists on disk. removing from database.", episodeFile.Path); + Logger.Trace("File [{0}] no longer exists on disk. removing from db", episodeFile.Path); //Set the EpisodeFileId for each episode attached to this file to 0 foreach (var episode in _episodeProvider.GetEpisodesByFileId(episodeFile.EpisodeFileId)) @@ -196,7 +196,7 @@ namespace NzbDrone.Core.Providers { Logger.Debug("Scanning '{0}' for episodes", path); - var filesOnDisk = _diskProvider.GetFiles(path, "*.*", SearchOption.AllDirectories); + var filesOnDisk = _diskProvider.GetFiles(path, SearchOption.AllDirectories); var mediaFileList = filesOnDisk.Where(c => MediaExtentions.Contains(Path.GetExtension(c).ToLower())).ToList(); diff --git a/NzbDrone.Core/Providers/IndexerProvider.cs b/NzbDrone.Core/Providers/IndexerProvider.cs index 6bb8a83b9..e82b19ef5 100644 --- a/NzbDrone.Core/Providers/IndexerProvider.cs +++ b/NzbDrone.Core/Providers/IndexerProvider.cs @@ -30,32 +30,32 @@ namespace NzbDrone.Core.Providers public virtual IList GetEnabledIndexers() { - var all = GetAllISettings(); + var all = All(); return _indexers.Where(i => all.Exists(c => c.IndexProviderType == i.GetType().ToString() && c.Enable)).ToList(); } - public virtual List GetAllISettings() + public virtual List All() { - return _database.Fetch(); + return _database.Fetch(); } - public virtual void SaveSettings(IndexerSetting settings) + public virtual void SaveSettings(IndexerDefinition definitions) { - if (settings.Id == 0) + if (definitions.Id == 0) { - Logger.Debug("Adding Indexer settings for {0}", settings.Name); - _database.Insert(settings); + Logger.Debug("Adding Indexer definitions for {0}", definitions.Name); + _database.Insert(definitions); } else { - Logger.Debug("Updating Indexer settings for {0}", settings.Name); - _database.Update(settings); + Logger.Debug("Updating Indexer definitions for {0}", definitions.Name); + _database.Update(definitions); } } - public virtual IndexerSetting GetSettings(Type type) + public virtual IndexerDefinition GetSettings(Type type) { - return _database.Single("WHERE IndexProviderType = @0", type.ToString()); + return _database.Single("WHERE IndexProviderType = @0", type.ToString()); } public virtual void InitializeIndexers(IList indexers) @@ -64,14 +64,14 @@ namespace NzbDrone.Core.Providers _indexers = indexers; - var currentIndexers = GetAllISettings(); + var currentIndexers = All(); foreach (var feedProvider in indexers) { IndexerBase indexerLocal = feedProvider; if (!currentIndexers.Exists(c => c.IndexProviderType == indexerLocal.GetType().ToString())) { - var settings = new IndexerSetting + var settings = new IndexerDefinition { Enable = false, IndexProviderType = indexerLocal.GetType().ToString(), diff --git a/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs b/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs index 5d4c26237..98c322578 100644 --- a/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs +++ b/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Providers.Jobs _seriesProvider.DeleteSeries(seriesId); - notification.CurrentMessage = String.Format("Successfully deleted '{0}'", title); + notification.CurrentMessage = String.Format("Successfully deleted '{0}' from database", title); } catch (Exception e) { diff --git a/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs b/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs index fc1ea6cf1..cc8b1a76d 100644 --- a/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs +++ b/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs @@ -53,11 +53,11 @@ namespace NzbDrone.Core.Providers.Jobs { notification.CurrentMessage = string.Format("Scanning disk for '{0}'", series.Title); _diskScanProvider.Scan(series); - notification.CurrentMessage = string.Format("Media File Scan completed for '{0}'", series.Title); + notification.CurrentMessage = string.Format("Disk Scan completed for '{0}'", series.Title); } catch (Exception e) { - Logger.ErrorException("An error has occured while scanning " + series.Title, e); + Logger.ErrorException("An error has occurred while scanning " + series.Title, e); } } } diff --git a/NzbDrone.Core/Providers/Jobs/ImportNewSeriesJob.cs b/NzbDrone.Core/Providers/Jobs/ImportNewSeriesJob.cs index 6d8c0d40f..6da507c41 100644 --- a/NzbDrone.Core/Providers/Jobs/ImportNewSeriesJob.cs +++ b/NzbDrone.Core/Providers/Jobs/ImportNewSeriesJob.cs @@ -73,6 +73,8 @@ namespace NzbDrone.Core.Providers.Jobs var updatedSeries = _seriesProvider.GetSeries(currentSeries.SeriesId); AutoIgnoreSeasons(updatedSeries.SeriesId); + notification.CurrentMessage = String.Format("{0} was successfully imported", updatedSeries.Title); + } catch (Exception e) { diff --git a/NzbDrone.Core/Providers/Jobs/JobProvider.cs b/NzbDrone.Core/Providers/Jobs/JobProvider.cs index ed19fa093..7e83f720e 100644 --- a/NzbDrone.Core/Providers/Jobs/JobProvider.cs +++ b/NzbDrone.Core/Providers/Jobs/JobProvider.cs @@ -40,26 +40,26 @@ namespace NzbDrone.Core.Providers.Jobs /// Returns a list of all registered jobs /// /// - public virtual List All() + public virtual List All() { - return _database.Fetch().ToList(); + return _database.Fetch().ToList(); } /// - /// Creates/Updates settings for a job + /// Creates/Updates definitions for a job /// - /// Settings to be created/updated - public virtual void SaveSettings(JobSetting settings) + /// Settings to be created/updated + public virtual void SaveSettings(JobDefinition definitions) { - if (settings.Id == 0) + if (definitions.Id == 0) { - Logger.Trace("Adding job settings for {0}", settings.Name); - _database.Insert(settings); + Logger.Trace("Adding job definitions for {0}", definitions.Name); + _database.Insert(definitions); } else { - Logger.Trace("Updating job settings for {0}", settings.Name); - _database.Update(settings); + Logger.Trace("Updating job definitions for {0}", definitions.Name); + _database.Update(definitions); } } @@ -73,7 +73,7 @@ namespace NzbDrone.Core.Providers.Jobs { if (_isRunning) { - Logger.Info("Another instance of this job is already running. Ignoring request."); + Logger.Trace("Queue is already running. Ignoring scheduler's request."); return false; } _isRunning = true; @@ -112,19 +112,19 @@ namespace NzbDrone.Core.Providers.Jobs /// Job is only added to the queue if same job with the same targetId doesn't already exist in the queue. public virtual bool QueueJob(Type jobType, int targetId = 0) { - Logger.Debug("Adding job ({0}:{1}) to the queue", jobType, targetId); + Logger.Debug("Adding [{0}:{1}] to the queue", jobType.Name, targetId); lock (Queue) { var queueTuple = new Tuple(jobType, targetId); if (Queue.Contains(queueTuple)) { - Logger.Info("Job ({0}:{1}) already exists in queue. Skipping.", jobType, targetId); + Logger.Info("[{0}:{1}] already exists in job queue. Skipping.", jobType.Name, targetId); return false; } Queue.Add(queueTuple); - Logger.Trace("Job ({0}:{1}) added to the queue", jobType, targetId); + Logger.Trace("Job [{0}:{1}] added to the queue", jobType.Name, targetId); } @@ -132,7 +132,7 @@ namespace NzbDrone.Core.Providers.Jobs { if (_isRunning) { - Logger.Trace("Queue is already running. Ignoring request."); + Logger.Trace("Queue is already running. No need to start it up."); return true; } _isRunning = true; @@ -150,7 +150,7 @@ namespace NzbDrone.Core.Providers.Jobs } catch (Exception e) { - Logger.ErrorException("Error has occured in queue processor thread", e); + Logger.ErrorException("Error has occurred in queue processor thread", e); } finally { @@ -164,7 +164,7 @@ namespace NzbDrone.Core.Providers.Jobs } else { - Logger.Warn("Execution lock has has fucked up. Thread still active. Ignoring request."); + Logger.Error("Execution lock has fucked up. Thread still active. Ignoring request."); return true; } @@ -230,7 +230,7 @@ namespace NzbDrone.Core.Providers.Jobs var jobImplementation = _jobs.Where(t => t.GetType() == jobType).FirstOrDefault(); if (jobImplementation == null) { - Logger.Error("Unable to locate implementation for '{0}'. Make sure its properly registered.", jobType.ToString()); + Logger.Error("Unable to locate implementation for '{0}'. Make sure it is properly registered.", jobType); return; } @@ -240,7 +240,7 @@ namespace NzbDrone.Core.Providers.Jobs { try { - Logger.Debug("Starting job '{0}'. Last execution {1}", settings.Name, settings.LastExecution); + Logger.Debug("Starting '{0}' job. Last execution {1}", settings.Name, settings.LastExecution); var sw = Stopwatch.StartNew(); @@ -252,12 +252,12 @@ namespace NzbDrone.Core.Providers.Jobs settings.Success = true; sw.Stop(); - Logger.Debug("Job '{0}' successfully completed in {1} seconds", jobImplementation.Name, sw.Elapsed.Minutes, + Logger.Debug("Job '{0}' successfully completed in {1}.{2} seconds.", jobImplementation.Name, sw.Elapsed.Seconds, sw.Elapsed.Milliseconds / 100, sw.Elapsed.Seconds); } catch (Exception e) { - Logger.ErrorException("An error has occurred while executing timer job " + jobImplementation.Name, e); + Logger.ErrorException("An error has occurred while executing job " + jobImplementation.Name, e); _notification.Status = ProgressNotificationStatus.Failed; _notification.CurrentMessage = jobImplementation.Name + " Failed."; @@ -286,7 +286,7 @@ namespace NzbDrone.Core.Providers.Jobs var timerProviderLocal = timer; if (!currentTimer.Exists(c => c.TypeName == timerProviderLocal.GetType().ToString())) { - var settings = new JobSetting + var settings = new JobDefinition { Enable = timerProviderLocal.DefaultInterval > 0, TypeName = timer.GetType().ToString(), diff --git a/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs b/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs index 0e80a24f1..0e16bf324 100644 --- a/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs +++ b/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs @@ -31,7 +31,7 @@ namespace NzbDrone.Core.Providers.Jobs public string Name { - get { return "Post Download Media File Scan"; } + get { return "Drop folder monitor"; } } public int DefaultInterval @@ -41,56 +41,60 @@ namespace NzbDrone.Core.Providers.Jobs public virtual void Start(ProgressNotification notification, int targetId) { - Logger.Debug("Starting New Download Scan Job"); var dropFolder = _configProvider.SabDropDirectory; if (String.IsNullOrWhiteSpace(dropFolder)) { - Logger.Debug("Skipping drop folder scan. No drop folder is defined."); + Logger.Debug("No drop folder is defined. Skipping."); return; } if (!_diskProvider.FolderExists(dropFolder)) { - Logger.Warn("Unable to Scan for New Downloads - folder Doesn't exist: {0}", dropFolder); + Logger.Warn("Unable to Scan for New Downloads - folder Doesn't exist: [{0}]", dropFolder); return; } foreach (var subfolder in _diskProvider.GetDirectories(dropFolder)) { - var subfolderInfo = new DirectoryInfo(subfolder); - - if (subfolderInfo.Name.StartsWith("_UNPACK_", StringComparison.CurrentCultureIgnoreCase)) + try { - Logger.Info("Folder [{0}] is still being unpacked. skipping.", subfolder); - continue; + var subfolderInfo = new DirectoryInfo(subfolder); + + if (subfolderInfo.Name.StartsWith("_UNPACK_", StringComparison.CurrentCultureIgnoreCase)) + { + Logger.Debug("Folder [{0}] is still being unpacked. skipping.", subfolder); + continue; + } + + if (subfolderInfo.Name.StartsWith("_FAILED_", StringComparison.CurrentCultureIgnoreCase)) + { + Logger.Debug("Folder [{0}] is marked as failed. skipping.", subfolder); + continue; + } + + //Parse the Folder name + var seriesName = Parser.ParseSeriesName(subfolderInfo.Name); + var series = _seriesProvider.FindSeries(seriesName); + + if (series == null) + { + Logger.Warn("Unable to Import new download, series doesn't exist in database."); + return; + } + + var importedFiles = _diskScanProvider.Scan(series, subfolder); + importedFiles.ForEach(file => _diskScanProvider.MoveEpisodeFile(file)); + + //Delete the folder only if all files were removed + if (_diskProvider.GetFiles(subfolder, SearchOption.AllDirectories).Length == 0) + _diskProvider.DeleteFolder(subfolder, false); } - - if (subfolderInfo.Name.StartsWith("_FAILED_", StringComparison.CurrentCultureIgnoreCase)) + catch (Exception e) { - Logger.Info("Folder [{0}] is marked as failed. skipping.", subfolder); - continue; + Logger.ErrorException("An error has occurred while importing " + subfolder, e); } - - //Parse the Folder name - var seriesName = Parser.ParseSeriesName(subfolderInfo.Name); - var series = _seriesProvider.FindSeries(seriesName); - - if (series == null) - { - Logger.Warn("Unable to Import new download, series is not being watched"); - return; - } - - var importedFiles = _diskScanProvider.Scan(series, subfolder); - importedFiles.ForEach(file => _diskScanProvider.MoveEpisodeFile(file)); - - //Delete the folder only if all files were removed - if (_diskProvider.GetFiles(subfolder, "*.*", SearchOption.AllDirectories).Length == 0) - _diskProvider.DeleteFolder(subfolder, false); } - - Logger.Debug("New Download Scan Job completed successfully"); } } } diff --git a/NzbDrone.Core/Providers/Jobs/RssSyncJob.cs b/NzbDrone.Core/Providers/Jobs/RssSyncJob.cs index 2c34ba43e..9fa4bf7f3 100644 --- a/NzbDrone.Core/Providers/Jobs/RssSyncJob.cs +++ b/NzbDrone.Core/Providers/Jobs/RssSyncJob.cs @@ -69,10 +69,12 @@ namespace NzbDrone.Core.Providers.Jobs } catch (Exception e) { - Logger.ErrorException("An error has occured while processing parse result items from " + episodeParseResult, e); + Logger.ErrorException("An error has occurred while processing parse result items from " + episodeParseResult, e); } } + notification.CurrentMessage = "RSS Sync Completed"; + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs b/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs index 8b507227f..ac4bd2fb3 100644 --- a/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs +++ b/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Providers.Jobs public string Name { - get { return "Update Info"; } + get { return "Update Episode Info"; } } public int DefaultInterval diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index 4ca37b3d7..6d464b29b 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -83,7 +83,7 @@ namespace NzbDrone.Core.Providers string path = series.Path; if (series.SeasonFolder) { - var seasonFolder = _configProvider.SeasonFolderFormat + var seasonFolder = _configProvider.SortingSeasonFolderFormat .Replace("%0s", seasonNumber.ToString("00")) .Replace("%s", seasonNumber.ToString()); @@ -115,7 +115,7 @@ namespace NzbDrone.Core.Providers public virtual int DeleteOrphaned() { - Logger.Trace("Deleting orphaned files."); + Logger.Trace("Deleting orphan files."); var updated = _database.Execute(@"DELETE FROM EpisodeFiles WHERE EpisodeFileId IN @@ -126,22 +126,23 @@ namespace NzbDrone.Core.Providers if (updated > 0) { - Logger.Debug("Removed {0} orphaned files.", updated); + Logger.Debug("Removed {0} orphan file(s) from database.S", updated); } return updated; } + public virtual string GetNewFilename(IList episodes, string seriesTitle, QualityTypes quality) { - var separatorStyle = EpisodeSortingHelper.GetSeparatorStyle(_configProvider.SeparatorStyle); - var numberStyle = EpisodeSortingHelper.GetNumberStyle(_configProvider.NumberStyle); + var separatorStyle = EpisodeSortingHelper.GetSeparatorStyle(_configProvider.SortingSeparatorStyle); + var numberStyle = EpisodeSortingHelper.GetNumberStyle(_configProvider.SortingNumberStyle); string episodeNames = episodes[0].Title; string result = String.Empty; - if (_configProvider.SeriesName) + if (_configProvider.SortingIncludeSeriesName) { result += seriesTitle + separatorStyle.Pattern; } @@ -150,7 +151,7 @@ namespace NzbDrone.Core.Providers if (episodes.Count > 1) { - var multiEpisodeStyle = EpisodeSortingHelper.GetMultiEpisodeStyle(_configProvider.MultiEpisodeStyle); + var multiEpisodeStyle = EpisodeSortingHelper.GetMultiEpisodeStyle(_configProvider.SortingMultiEpisodeStyle); foreach (var episode in episodes.OrderBy(e => e.EpisodeNumber).Skip(1)) { @@ -174,19 +175,19 @@ namespace NzbDrone.Core.Providers .Replace("%x", numberStyle.EpisodeSeparator) .Replace("%p", separatorStyle.Pattern); - if (_configProvider.EpisodeName) + if (_configProvider.SortingIncludeEpisodeTitle) { episodeNames = episodeNames.TrimEnd(' ', '+'); result += separatorStyle.Pattern + episodeNames; } - if (_configProvider.AppendQuality) + if (_configProvider.SortingAppendQuality) result += String.Format(" [{0}]", quality); - if (_configProvider.ReplaceSpaces) + if (_configProvider.SortingReplaceSpaces) result = result.Replace(' ', '.'); - Logger.Trace("New File Name is: {0}", result.Trim()); + Logger.Trace("New File Name is: [{0}]", result.Trim()); return CleanFilename(result.Trim()); } diff --git a/NzbDrone.Core/Providers/QualityProvider.cs b/NzbDrone.Core/Providers/QualityProvider.cs index fc9fd5353..33660adbf 100644 --- a/NzbDrone.Core/Providers/QualityProvider.cs +++ b/NzbDrone.Core/Providers/QualityProvider.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Providers _database.Delete(profileId); } - public virtual List GetAllProfiles() + public virtual List All() { var profiles = _database.Fetch().ToList(); @@ -58,9 +58,10 @@ namespace NzbDrone.Core.Providers public virtual void SetupDefaultProfiles() { - Logger.Info("Setting up default quality profiles"); + if (All().Count != 0) + return; - var profiles = GetAllProfiles(); + Logger.Info("Setting up default quality profiles"); var sd = new QualityProfile { Name = "SD", Allowed = new List { QualityTypes.SDTV, QualityTypes.DVD }, Cutoff = QualityTypes.SDTV }; @@ -71,23 +72,9 @@ namespace NzbDrone.Core.Providers Cutoff = QualityTypes.HDTV }; - //Add or Update SD - Logger.Debug(String.Format("Checking for default QualityProfile: {0}", sd.Name)); - var sdDb = profiles.Where(p => p.Name == sd.Name).FirstOrDefault(); - if (sdDb == null) - { - Logger.Debug(String.Format("Adding new default QualityProfile: {0}", sd.Name)); - Add(sd); - } + Add(sd); + Add(hd); - //Add or Update HD - Logger.Debug(String.Format("Checking for default QualityProfile: {0}", hd.Name)); - var hdDb = profiles.Where(p => p.Name == hd.Name).FirstOrDefault(); - if (hdDb == null) - { - Logger.Debug(String.Format("Adding new default QualityProfile: {0}", hd.Name)); - Add(hd); - } } } } \ No newline at end of file diff --git a/NzbDrone.Core/Providers/SceneMappingProvider.cs b/NzbDrone.Core/Providers/SceneMappingProvider.cs index 1c4d38808..3dbceb3ce 100644 --- a/NzbDrone.Core/Providers/SceneMappingProvider.cs +++ b/NzbDrone.Core/Providers/SceneMappingProvider.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Providers public SceneMappingProvider() { - + } public virtual bool UpdateMappings() @@ -38,7 +38,7 @@ namespace NzbDrone.Core.Providers while ((line = reader.ReadLine()) != null) { var split = line.Split(','); - var seriesId = 0; + int seriesId; Int32.TryParse(split[1], out seriesId); var map = new SceneMapping(); diff --git a/NzbDrone.Core/Providers/SeriesProvider.cs b/NzbDrone.Core/Providers/SeriesProvider.cs index 2a5987214..ac908c260 100644 --- a/NzbDrone.Core/Providers/SeriesProvider.cs +++ b/NzbDrone.Core/Providers/SeriesProvider.cs @@ -109,7 +109,7 @@ namespace NzbDrone.Core.Providers repoSeries.Monitored = true; //New shows should be monitored repoSeries.QualityProfileId = qualityProfileId; if (qualityProfileId == 0) - repoSeries.QualityProfileId = Convert.ToInt32(_configProvider.GetValue("DefaultQualityProfile", "1")); + repoSeries.QualityProfileId = _configProvider.DefaultQualityProfile; repoSeries.SeasonFolder = _configProvider.UseSeasonFolder; diff --git a/NzbDrone.Core/Repository/IndexerSetting.cs b/NzbDrone.Core/Repository/IndexerDefinition.cs similarity index 80% rename from NzbDrone.Core/Repository/IndexerSetting.cs rename to NzbDrone.Core/Repository/IndexerDefinition.cs index b1a8ad1be..f32879cc7 100644 --- a/NzbDrone.Core/Repository/IndexerSetting.cs +++ b/NzbDrone.Core/Repository/IndexerDefinition.cs @@ -3,9 +3,9 @@ using PetaPoco; namespace NzbDrone.Core.Repository { - [TableName("IndexerSettings")] + [TableName("IndexerDefinitions")] [PrimaryKey("Id", autoIncrement = true)] - public class IndexerSetting + public class IndexerDefinition { public int Id { get; set; } diff --git a/NzbDrone.Core/Repository/JobSetting.cs b/NzbDrone.Core/Repository/JobDefinition.cs similarity index 87% rename from NzbDrone.Core/Repository/JobSetting.cs rename to NzbDrone.Core/Repository/JobDefinition.cs index 1ab02fff7..3eb1dcec9 100644 --- a/NzbDrone.Core/Repository/JobSetting.cs +++ b/NzbDrone.Core/Repository/JobDefinition.cs @@ -3,9 +3,9 @@ using PetaPoco; namespace NzbDrone.Core.Repository { - [TableName("JobSettings")] + [TableName("JobDefinitions")] [PrimaryKey("Id", autoIncrement = true)] - public class JobSetting + public class JobDefinition { public Int32 Id { get; set; } diff --git a/NzbDrone.Core/packages.config b/NzbDrone.Core/packages.config index 4668ad886..399a6aebb 100644 --- a/NzbDrone.Core/packages.config +++ b/NzbDrone.Core/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/NzbDrone.Web/Content/NzbDrone.css b/NzbDrone.Web/Content/NzbDrone.css index 0c641c12c..0d8a5822e 100644 --- a/NzbDrone.Web/Content/NzbDrone.css +++ b/NzbDrone.Web/Content/NzbDrone.css @@ -223,3 +223,10 @@ select display: block; height: 25px; } + + +.dialog +{ + margin-left: auto; + margin-right: auto; +} \ No newline at end of file diff --git a/NzbDrone.Web/Content/Overrides.css b/NzbDrone.Web/Content/Overrides.css index ae70bb954..36c187f82 100644 --- a/NzbDrone.Web/Content/Overrides.css +++ b/NzbDrone.Web/Content/Overrides.css @@ -8,4 +8,11 @@ .yui3-aclist-item-active { background: #065EFE !important; -} \ No newline at end of file +} + + +/*jQuery UI*/ +.ui-widget-header +{ + font-weight: normal; +} diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_0b58a2_40x40.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_0b58a2_40x40.png deleted file mode 100644 index 6b73385d7..000000000 Binary files a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_0b58a2_40x40.png and /dev/null differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png index 263c7568b..e0ccaa6ea 100644 Binary files a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png and b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_0_065efe_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_0_065efe_40x100.png new file mode 100644 index 000000000..fbc027f8f Binary files /dev/null and b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_0_065efe_40x100.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_0_0b3e6f_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_0_0b3e6f_40x100.png deleted file mode 100644 index ec0da7e93..000000000 Binary files a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_0_0b3e6f_40x100.png and /dev/null differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_20_111111_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_20_111111_40x100.png deleted file mode 100644 index 2e9365e9b..000000000 Binary files a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_20_111111_40x100.png and /dev/null differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_20_ffffff_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_20_ffffff_40x100.png new file mode 100644 index 000000000..ac8b229af Binary files /dev/null and b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_20_ffffff_40x100.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_30_065efe_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_30_065efe_40x100.png new file mode 100644 index 000000000..fbc027f8f Binary files /dev/null and b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_30_065efe_40x100.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_40_00498f_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_40_00498f_40x100.png deleted file mode 100644 index 9a14f866d..000000000 Binary files a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_40_00498f_40x100.png and /dev/null differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_40_065efe_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_40_065efe_40x100.png new file mode 100644 index 000000000..fbc027f8f Binary files /dev/null and b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_flat_40_065efe_40x100.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-bg_white-lines_10_000000_40x100.png b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_white-lines_10_000000_40x100.png new file mode 100644 index 000000000..c5187eb35 Binary files /dev/null and b/NzbDrone.Web/Content/jQueryUI/images/ui-bg_white-lines_10_000000_40x100.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png b/NzbDrone.Web/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png index 782df8f97..81c5eb0bc 100644 Binary files a/NzbDrone.Web/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png and b/NzbDrone.Web/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png differ diff --git a/NzbDrone.Web/Content/jQueryUI/jquery-ui-1.8.14.nzbdrone.css b/NzbDrone.Web/Content/jQueryUI/jquery-ui-1.8.14.nzbdrone.css index 6c9f2b7ab..7c521270c 100644 --- a/NzbDrone.Web/Content/jQueryUI/jquery-ui-1.8.14.nzbdrone.css +++ b/NzbDrone.Web/Content/jQueryUI/jquery-ui-1.8.14.nzbdrone.css @@ -50,7 +50,7 @@ * * http://docs.jquery.com/UI/Theming/API * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=&fwDefault=normal&fsDefault=&cornerRadius=0px&bgColorHeader=0b3e6f&bgTextureHeader=01_flat.png&bgImgOpacityHeader=0&borderColorHeader=0b3e6f&fcHeader=f6f6f6&iconColorHeader=98d2fb&bgColorContent=111111&bgTextureContent=01_flat.png&bgImgOpacityContent=20&borderColorContent=000000&fcContent=d9d9d9&iconColorContent=9ccdfc&bgColorDefault=333333&bgTextureDefault=01_flat.png&bgImgOpacityDefault=20&borderColorDefault=333333&fcDefault=ffffff&iconColorDefault=9ccdfc&bgColorHover=00498f&bgTextureHover=01_flat.png&bgImgOpacityHover=40&borderColorHover=222222&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=00498f&bgTextureActive=01_flat.png&bgImgOpacityActive=40&borderColorActive=222222&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=0b58a2&bgTextureHighlight=08_diagonals_thick.png&bgImgOpacityHighlight=30&borderColorHighlight=052f57&fcHighlight=ffffff&iconColorHighlight=ffffff&bgColorError=a32d00&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=30&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=&fwDefault=normal&fsDefault=&cornerRadius=1px&bgColorHeader=065efe&bgTextureHeader=01_flat.png&bgImgOpacityHeader=0&borderColorHeader=065efe&fcHeader=f6f6f6&iconColorHeader=98d2fb&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=20&borderColorContent=a8a8a8&fcContent=&iconColorContent=9ccdfc&bgColorDefault=333333&bgTextureDefault=01_flat.png&bgImgOpacityDefault=20&borderColorDefault=a8a8a8&fcDefault=ffffff&iconColorDefault=9ccdfc&bgColorHover=065efe&bgTextureHover=01_flat.png&bgImgOpacityHover=40&borderColorHover=a8a8a8&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=065efe&bgTextureActive=01_flat.png&bgImgOpacityActive=40&borderColorActive=a8a8a8&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=065efe&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=30&borderColorHighlight=065efe&fcHighlight=ffffff&iconColorHighlight=ffffff&bgColorError=a32d00&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=30&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=000000&bgTextureOverlay=11_white_lines.png&bgImgOpacityOverlay=10&opacityOverlay=60&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=0px%20 */ @@ -59,24 +59,24 @@ .ui-widget { font-family: ; font-size: ; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: ; font-size: 1em; } -.ui-widget-content { border: 1px solid #000000; background: #111111 url(images/ui-bg_flat_20_111111_40x100.png) 50% 50% repeat-x; color: #d9d9d9; } -.ui-widget-content a { color: #d9d9d9; } -.ui-widget-header { border: 1px solid #0b3e6f; background: #0b3e6f url(images/ui-bg_flat_0_0b3e6f_40x100.png) 50% 50% repeat-x; color: #f6f6f6; font-weight: bold; } +.ui-widget-content { border: 1px solid #a8a8a8; background: #ffffff url(images/ui-bg_flat_20_ffffff_40x100.png) 50% 50% repeat-x; color: #; } +.ui-widget-content a { color: #; } +.ui-widget-header { border: 1px solid #065efe; background: #065efe url(images/ui-bg_flat_0_065efe_40x100.png) 50% 50% repeat-x; color: #f6f6f6; font-weight: bold; } .ui-widget-header a { color: #f6f6f6; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #333333; background: #333333 url(images/ui-bg_flat_20_333333_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #a8a8a8; background: #333333 url(images/ui-bg_flat_20_333333_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #222222; background: #00498f url(images/ui-bg_flat_40_00498f_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #a8a8a8; background: #065efe url(images/ui-bg_flat_40_065efe_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } .ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #222222; background: #00498f url(images/ui-bg_flat_40_00498f_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #a8a8a8; background: #065efe url(images/ui-bg_flat_40_065efe_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #052f57; background: #0b58a2 url(images/ui-bg_diagonals-thick_30_0b58a2_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #065efe; background: #065efe url(images/ui-bg_flat_30_065efe_40x100.png) 50% 50% repeat-x; color: #ffffff; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #ffffff; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #a32d00 url(images/ui-bg_diagonals-thick_30_a32d00_40x40.png) 50% 50% repeat; color: #ffffff; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } @@ -280,14 +280,14 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 0px; -webkit-border-top-left-radius: 0px; -khtml-border-top-left-radius: 0px; border-top-left-radius: 0px; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 0px; -webkit-border-top-right-radius: 0px; -khtml-border-top-right-radius: 0px; border-top-right-radius: 0px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; -khtml-border-bottom-left-radius: 0px; border-bottom-left-radius: 0px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; -khtml-border-bottom-right-radius: 0px; border-bottom-right-radius: 0px; } +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 1px; -webkit-border-top-left-radius: 1px; -khtml-border-top-left-radius: 1px; border-top-left-radius: 1px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 1px; -webkit-border-top-right-radius: 1px; -khtml-border-top-right-radius: 1px; border-top-right-radius: 1px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 1px; -webkit-border-bottom-left-radius: 1px; -khtml-border-bottom-left-radius: 1px; border-bottom-left-radius: 1px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 1px; -webkit-border-bottom-right-radius: 1px; -khtml-border-bottom-right-radius: 1px; border-bottom-right-radius: 1px; } /* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* +.ui-widget-overlay { background: #000000 url(images/ui-bg_white-lines_10_000000_40x100.png) 50% 50% repeat; opacity: .60;filter:Alpha(Opacity=60); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 0px ; -khtml-border-radius: 0px ; -webkit-border-radius: 0px ; border-radius: 0px ; }/* * jQuery UI Resizable 1.8.14 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) diff --git a/NzbDrone.Web/Controllers/AddSeriesController.cs b/NzbDrone.Web/Controllers/AddSeriesController.cs index 5916152fb..4caf1d731 100644 --- a/NzbDrone.Web/Controllers/AddSeriesController.cs +++ b/NzbDrone.Web/Controllers/AddSeriesController.cs @@ -49,17 +49,12 @@ namespace NzbDrone.Web.Controllers public ActionResult AddNew() { - var rootDirs = _rootFolderProvider.GetAll().Select(r => - new RootDirModel - { - Path = r.Path, - CleanPath = r.Path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`') - }); - ViewData["RootDirs"] = rootDirs.ToList(); - ViewData["DirSep"] = Path.DirectorySeparatorChar.ToString().Replace(Path.DirectorySeparatorChar, '|'); + ViewData["RootDirs"] = _rootFolderProvider.GetAll().Select(c => c.Path).OrderBy(e => e).ToList(); var defaultQuality = _configProvider.DefaultQualityProfile; - var qualityProfiles = _qualityProvider.GetAllProfiles(); + var qualityProfiles = _qualityProvider.All(); + + ViewData["qualityList"] = qualityProfiles; ViewData["quality"] = new SelectList( qualityProfiles, @@ -74,7 +69,7 @@ namespace NzbDrone.Web.Controllers { var rootDirs = _rootFolderProvider.GetAll(); - var profiles = _qualityProvider.GetAllProfiles(); + var profiles = _qualityProvider.All(); var defaultQuality = Convert.ToInt32(_configProvider.DefaultQualityProfile); var selectList = new SelectList(profiles, "QualityProfileId", "Name", defaultQuality); ViewData["qualities"] = selectList; @@ -111,7 +106,7 @@ namespace NzbDrone.Web.Controllers ViewData["javaPath"] = path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`'); var defaultQuality = _configProvider.DefaultQualityProfile; - var qualityProfiles = _qualityProvider.GetAllProfiles(); + var qualityProfiles = _qualityProvider.All(); ViewData["quality"] = new SelectList( qualityProfiles, diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 1dbb80a99..61c1a53f9 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Web.Controllers public ActionResult Index() { - var profiles = _qualityProvider.GetAllProfiles(); + var profiles = _qualityProvider.All(); ViewData["SelectList"] = new SelectList(profiles, "QualityProfileId", "Name"); return View(); diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index d2b9a42e8..5223e4945 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -116,7 +116,7 @@ namespace NzbDrone.Web.Controllers ViewData["Qualities"] = qualityTypes; - var profiles = _qualityProvider.GetAllProfiles().ToList(); + var profiles = _qualityProvider.All().ToList(); foreach (var qualityProfile in profiles) { @@ -157,15 +157,15 @@ namespace NzbDrone.Web.Controllers { var model = new EpisodeSortingModel(); - model.SeriesName = _configProvider.SeriesName; - model.EpisodeName = _configProvider.EpisodeName; - model.ReplaceSpaces = _configProvider.ReplaceSpaces; - model.AppendQuality = _configProvider.AppendQuality; + model.SeriesName = _configProvider.SortingIncludeSeriesName; + model.EpisodeName = _configProvider.SortingIncludeEpisodeTitle; + model.ReplaceSpaces = _configProvider.SortingReplaceSpaces; + model.AppendQuality = _configProvider.SortingAppendQuality; model.SeasonFolders = _configProvider.UseSeasonFolder; - model.SeasonFolderFormat = _configProvider.SeasonFolderFormat; - model.SeparatorStyle = _configProvider.SeparatorStyle; - model.NumberStyle = _configProvider.NumberStyle; - model.MultiEpisodeStyle = _configProvider.MultiEpisodeStyle; + model.SeasonFolderFormat = _configProvider.SortingSeasonFolderFormat; + model.SeparatorStyle = _configProvider.SortingSeparatorStyle; + model.NumberStyle = _configProvider.SortingNumberStyle; + model.MultiEpisodeStyle = _configProvider.SortingMultiEpisodeStyle; model.SeparatorStyles = new SelectList(EpisodeSortingHelper.GetSeparatorStyles(), "Id", "Name"); model.NumberStyles = new SelectList(EpisodeSortingHelper.GetNumberStyles(), "Id", "Name"); @@ -223,7 +223,7 @@ namespace NzbDrone.Web.Controllers public QualityModel GetUpdatedProfileList() { - var profiles = _qualityProvider.GetAllProfiles().ToList(); + var profiles = _qualityProvider.All().ToList(); var defaultQualityQualityProfileId = Convert.ToInt32(_configProvider.GetValue("DefaultQualityProfile", profiles[0].QualityProfileId)); var selectList = new SelectList(profiles, "QualityProfileId", "Name"); @@ -423,15 +423,15 @@ namespace NzbDrone.Web.Controllers if (ModelState.IsValid) { - _configProvider.SeriesName = data.SeriesName; - _configProvider.EpisodeName = data.EpisodeName; - _configProvider.ReplaceSpaces = data.ReplaceSpaces; - _configProvider.AppendQuality = data.AppendQuality; + _configProvider.SortingIncludeSeriesName = data.SeriesName; + _configProvider.SortingIncludeEpisodeTitle = data.EpisodeName; + _configProvider.SortingReplaceSpaces = data.ReplaceSpaces; + _configProvider.SortingAppendQuality = data.AppendQuality; _configProvider.UseSeasonFolder = data.SeasonFolders; - _configProvider.SeasonFolderFormat = data.SeasonFolderFormat; - _configProvider.SeparatorStyle = data.SeparatorStyle; - _configProvider.NumberStyle = data.NumberStyle; - _configProvider.MultiEpisodeStyle = data.MultiEpisodeStyle; + _configProvider.SortingSeasonFolderFormat = data.SeasonFolderFormat; + _configProvider.SortingSeparatorStyle = data.SeparatorStyle; + _configProvider.SortingNumberStyle = data.NumberStyle; + _configProvider.SortingMultiEpisodeStyle = data.MultiEpisodeStyle; basicNotification.Title = SETTINGS_SAVED; _notificationProvider.Register(basicNotification); diff --git a/NzbDrone.Web/Controllers/SystemController.cs b/NzbDrone.Web/Controllers/SystemController.cs index f31f3db6e..3a9966ca7 100644 --- a/NzbDrone.Web/Controllers/SystemController.cs +++ b/NzbDrone.Web/Controllers/SystemController.cs @@ -33,7 +33,7 @@ namespace NzbDrone.Web.Controllers public ActionResult Indexers() { - return View(_indexerProvider.GetAllISettings()); + return View(_indexerProvider.All()); } diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index cdc7f718a..5e14a3267 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -50,9 +50,9 @@ ..\Libraries\MVC3\Microsoft.Web.Infrastructure.dll True - + False - ..\packages\MiniProfiler.1.3\lib\MvcMiniProfiler.dll + ..\packages\MiniProfiler.1.4\lib\MvcMiniProfiler.dll ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll diff --git a/NzbDrone.Web/Properties/AssemblyInfo.cs b/NzbDrone.Web/Properties/AssemblyInfo.cs index 5cce0429f..752fec6d1 100644 --- a/NzbDrone.Web/Properties/AssemblyInfo.cs +++ b/NzbDrone.Web/Properties/AssemblyInfo.cs @@ -34,4 +34,4 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.2.0.*")] \ No newline at end of file +[assembly: AssemblyVersion("0.5.0.*")] \ No newline at end of file diff --git a/NzbDrone.Web/Views/AddSeries/AddNew.cshtml b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml index 0944f372c..124afee72 100644 --- a/NzbDrone.Web/Views/AddSeries/AddNew.cshtml +++ b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml @@ -1,22 +1,11 @@ -@using NzbDrone.Web.Models -@{ - Layout = null; -} +@using System.Collections +@using NzbDrone.Web.Models +@{ Layout = null; }
-
- Root Directory - @{int d = 0; - - foreach (var dir in ViewData["RootDirs"] as List) - { -
- @Html.RadioButton("selectedRootDir", dir.CleanPath, d == 0, new { @class = "dirList examplePart", id = "dirRadio_" + d }) - @Html.Label(dir.Path) - @{ d++; } -
- } - } -
+ @Html.Label("Root Directory") + @Html.DropDownList("rootDirList", new SelectList((IList)ViewData["RootDirs"])) + @Html.Label("Quality") + @Html.DropDownList("qualityList", new SelectList((IList)ViewData["QualityList"], "QualityProfileId", "Name"))

diff --git a/NzbDrone.Web/Views/AddSeries/Index.cshtml b/NzbDrone.Web/Views/AddSeries/Index.cshtml index aab13e9f5..7d4022af2 100644 --- a/NzbDrone.Web/Views/AddSeries/Index.cshtml +++ b/NzbDrone.Web/Views/AddSeries/Index.cshtml @@ -1,45 +1,40 @@ @model List @using NzbDrone.Core.Repository - @section HeaderContent { } - @section TitleContent{ Add Series } @section MainContent{ - @{ Html.Telerik().Window() - .Name("Window") - .Title("Add New Series") - .Modal(true) - .Buttons(b => b.Close()) - .Width(500) - .Height(200) - .Visible(false) - .Draggable(true) - .Resizable(resizing => resizing.Enabled(false)) - .LoadContentFrom("AddNew", "AddSeries") - .Render(); - } -
- - @Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList)ViewData["qualities"]).HtmlAttributes( - new { style = "width: 100px; margin-left:224px;" }).ClientEvents(events => events.OnChange("masterChanged")) +
+ @{ Html.RenderAction("AddNew", "AddSeries"); }
- @{Html.RenderAction("RootDir");}
+
+ + @Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList)ViewData["qualities"]).HtmlAttributes( + new { style = "width: 100px; margin-left:224px;" }).ClientEvents(events => events.OnChange("masterChanged")) +
@{ Html.RenderAction("AddExisting", "AddSeries"); }
} - - @section Scripts {