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
using System; | |
public static class ShortUrlTokenGenerator | |
{ | |
private const string alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; | |
private static Random generator = new Random(); | |
public static string GenerateToken(int tokenLength) | |
{ | |
var builder = new StringBuilder(); |
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 SubscriptionController : Controller | |
{ | |
public SubscriptionController(ISubscriberRepository subscriberRepository, IObserver<SubscribedToNewsletter> subscribedToNewsletterObserver, IObserver<UnsubscribedFromNewsletter> unsubscribedFromNewsletterObserver) | |
{ | |
SubscriberRepository = subscriberRepository; | |
SubscribedToNewsletterObserver = subscribedToNewsletterObserver; | |
UnsubscribedFromNewsletterObserver = unsubscribedFromNewsletterObserver; | |
} | |
} |
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
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using MSTestContrib.Specifications; | |
namespace Calculator.Core.Specifications | |
{ | |
[TestClass] | |
[SpecificationDescription("As a user I want to perform mathematical calculations so that my head doesn't hurt.")] | |
public class BasicCalculatorSpecification : Specification | |
{ |
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
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using MSTestContrib.Specifications; | |
namespace Calculator.Core.Specifications | |
{ | |
[TestClass] | |
[SpecificationDescription("As a user I want to perform mathematical calculations so that my head doesn't hurt.")] | |
public class BasicCalculatorSpecification : Specification | |
{ |
NewerOlder