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
class EmailSenderContext | |
{ | |
protected static void email_was_sent() | |
{ | |
SmailSender.SendEmail(); | |
} | |
} | |
class When_an_email_is_sent : EmailSenderContext | |
{ |
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
Because we_did_something_we shouldnt = () => | |
{ | |
Exception = Catch.Exception(() => DevTeam.ReWriteFromScratch()); | |
}; |
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
class DevTeamContext | |
{ | |
protected static bool ExpectingException; | |
protected static Exception Exception; | |
protected static void dev_team_was_asked_to_do_a_rewrite() | |
{ | |
var ex = Catch.Exception(() => DevTeam.ReWriteFromScratch()); | |
if(ExpectingException) | |
Exception = ex; |
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
class When_a_development_is_asked_to_do_a_rewrite : | |
{ | |
Establish context = () => Expecting.Exception(); | |
Because the_dev_team_was_asked_to_do_a_rewrite = () => DevTeam.ReWriteFromScratch(); | |
It should_not_allow_the_dev_team_to_do_a_rewrite = () => Thrown.Exception.ShouldBeOfType<ProgrammersBeenGivenTooMuchFreedomException>(); | |
} |
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
class When_there_are_100_bottles_of_beer_on_the_wall : BottlesOfBeerContext | |
{ | |
Establish there_are = () => 100.bottles_of_beer_on_the_wall(); | |
Because we = take_one_down_and_pass_it_around; | |
It should_only_have_99_bottles_of_beer_on_the_wall = () => Bottles_of_beer_on_the_wall.ShouldEqual(99); | |
} | |
public static class BottlesOfBeerSetup | |
{ | |
public static void bottles_of_beer_on_the_wall(this int numBottlesOfBeer) |
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 static class ActionResultExtensions | |
{ | |
public static void ShouldBeAPartialView(this ActionResult actionResult) | |
{ | |
actionResult.ShouldBeOfType<PartialViewResult>(); | |
} | |
} |
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
class Song | |
{ | |
public void Sing() | |
{ | |
Wall wall = new Wall(); | |
wall.Beers.Add(new Beer("Peroni")); | |
foreach (Beer beer in wall.Beers) | |
{ |
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
private string _foo; | |
public string Foo | |
{ | |
get { return _foo; } | |
set { _foo = value; } | |
} |
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
var container = new WindsorContainer(); | |
container.Install(new ConfigurationInstaller()); | |
container.RegisterConfigurationEntity<Example>(); | |
var example = container.Resolve<Example>(); | |
if(example.IsAwesome) | |
Console.WriteLine("This is {0} awesome. Its level {1} awesome", example.HowAwesome, example.LevelOfAwesome); |
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
var call = new XmlApiCall | |
{ | |
Codec = new XmlCodec(), | |
Username = Settings.MeetingsManager, | |
Password = Settings.Password, | |
RequestAuthenticationMechanism = new OAuthWrapAuthenticationMechanism(OAuthToken) | |
}; | |
var calendar = call.Get<WorkspaceCalendar>("v2/calendar/workspaces/123").Data; |
OlderNewer