This file contains 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
public class Indexer | |
{ | |
private Dictionary<string, List<string>> termToIds = | |
new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase); | |
private Dictionary<string, List<string>> idToTerms = | |
new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase); | |
public void Index(string docId, string text) | |
{ |
This file contains 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
public class Global : System.Web.HttpApplication | |
{ | |
private readonly string connectionString = ConfigurationManager.ConnectionStrings["teamCity"].ConnectionString; | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
} | |
protected void Session_Start(object sender, EventArgs e) |
This file contains 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
/****** Object: Index [IX_Commits_Ordered] Script Date: 11/28/2014 11:59:00 ******/ | |
CREATE NONCLUSTERED INDEX [IX_Commits_Ordered] ON [dbo].[Commits] | |
( | |
[CommitSequence] ASC, | |
[StreamId] ASC, | |
[StreamRevision] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = OFF, ALLOW_PAGE_LOCKS = OFF) ON [PRIMARY] | |
GO |
This file contains 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
namespace Infrastructure | |
{ | |
using System; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using Nancy; | |
using Util; |
This file contains 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
namespace WordWatch.Server.Api | |
{ | |
using System; | |
using System.IO; | |
using System.IO.Abstractions; | |
using Nancy; | |
using Nancy.Helpers; | |
using Nancy.Responses; |
This file contains 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
[TestFixture] | |
public class MessagingAcceptanceTests | |
{ | |
[Test] | |
public void All_commands_are_decorated_with_data_contract() | |
{ | |
var messageTypes = typeof(Command).Assembly.GetTypes() | |
.Where(typeof(Command).IsAssignableFrom) | |
.Where(type => type.IsClass && false == type.IsAbstract); |
This file contains 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
namespace Nancy.Validation.FluentValidation.Tests | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Nancy.Bootstrapper; | |
using Nancy.ModelBinding; | |
using Nancy.Testing; | |
using Nancy.TinyIoc; |
This file contains 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
public class CreateUserValidator : AbstractValidator<CreateUser> | |
{ | |
public CreateUserValidator(IUserRepository repository) | |
{ | |
this.RuleFor(x => x.UserName) | |
.NotEmpty() | |
.Length(1, 255); | |
this.RuleFor(x => x.UserName) | |
.Must(x => x != null && !x.Any(char.IsWhiteSpace)) |
This file contains 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
/// <summary> | |
/// Provides a mockable implementation of System.DateTime.Now; | |
/// </summary> | |
public static class SystemDateTime | |
{ | |
private static readonly Func<DateTime> DefaultProvider = () => DateTime.Now; | |
[ThreadStatic] | |
private static Func<DateTime> dateTimeProvider; |
This file contains 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
/// <summary>The observable extensions.</summary> | |
public static class ObservableExtensions | |
{ | |
/// <summary>Aggregates a Stream using the supplied Aggregator until the given predicate is true</summary> | |
/// <param name="source">The source.</param> | |
/// <param name="seed">The seed.</param> | |
/// <param name="accumulator">The accumulator.</param> | |
/// <param name="predicate">A predicate which indicates whether the aggregation is completed.</param> | |
/// <typeparam name="TSource">The Type of the Source stream.</typeparam> | |
/// <typeparam name="TAccumulate">The Type of the Accumulator.</typeparam> |