This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| public static class EnumerableAssert | |
| { | |
| /// <summary> | |
| /// Assert that an array, list or other collection is empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| public static class DateTimeExtensions | |
| { | |
| public static bool IsBusinessDay(this DateTime date) | |
| { | |
| return date.DayOfWeek != DayOfWeek.Saturday | |
| && date.DayOfWeek != DayOfWeek.Sunday; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Threading.Tasks; | |
| using Moq.Language; | |
| using Moq.Language.Flow; | |
| public static class MoqExtensions | |
| { | |
| //see: http://haacked.com/archive/2010/11/24/moq-sequences-revisited.aspx/ | |
| public static void ReturnsInOrder<T, TResult>(this ISetup<T, TResult> setup, params object[] results) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Reflection; | |
| internal class ObjectRenderer | |
| { | |
| private TextWriter writer; | |
| private static readonly Func<PropertyInfo, object, object> propertyGetter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| public static class TaskExtensions | |
| { | |
| public static T RunTaskSynchronously<T>(this Task<T> task) | |
| { | |
| using (NoSynchronizationContextScope.Enter()) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| public static class ConvertExtensions | |
| { | |
| public static T To<T>(this object obj) | |
| { | |
| try | |
| { | |
| Type type = typeof(T); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net.Http; | |
| internal class EmptyContent : ByteArrayContent | |
| { | |
| public EmptyContent() | |
| : base(new byte[0]) | |
| { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Specialized; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using Moq; | |
| //http://mdavies.net/2013/06/07/unit-testing-mvc3mvc4-model-binders/ | |
| public abstract class ModelBinderTestsBase<TBinder, TModel> | |
| where TBinder : IModelBinder, new() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net; | |
| using System.Net.Http; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using System.Web.Http; | |
| public class NotAcceptableResult : IHttpActionResult | |
| { | |
| private readonly HttpRequestMessage request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Register-Watcher-ToCopy { | |
| param ( | |
| [string]$sourceFolder, | |
| [string]$destFolder, | |
| [string]$id | |
| ) | |
| $filter = "*.*" | |
| $watcher = New-Object System.IO.FileSystemWatcher $sourceFolder, $filter -Property @{ | |
| IncludeSubdirectories = $true |
OlderNewer