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 NUnit.Framework; | |
| using TestStack.BDDfy.Core; | |
| using TestStack.BDDfy.Scanners.StepScanners.Fluent; | |
| namespace TestStack.BDDfy.Samples.Atm | |
| { | |
| [Story( | |
| AsA = "As an Account Holder", | |
| IWant = "I want to withdraw cash from an ATM", | |
| SoThat = "So that I can get money when the bank is closed")] |
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
| public class FooController : Controller{ | |
| IService service; | |
| public FooController(IService service){ | |
| this.service = service; | |
| } | |
| public ActionResult Bar(){ | |
| service.DoStuff(); | |
| } |
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
| var cb = new ContainerBuilder(); | |
| cb.RegisterType<Foo>().As<IFoo>().InstancePerLifetimeScope(); | |
| cb.RegisterType<Bar>().As<IBar>().InstancePerMatchingLifetimeScope("LifetimeScopeTag"); | |
| var container = cb.Build(); | |
| using (var scope = container.BeginLifetimeScope("LifetimeScopeTag")) | |
| { | |
| IFoo foo1; | |
| IFoo foo2; | |
| IBar bar1; |
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
| void Main() | |
| { | |
| var app = Application.LaunchWindows8Application("Microsoft.BingWeather_8wekyb3d8bbwe!App"); | |
| var window = app.GetWindows().Single(); | |
| OpenAppBar(); | |
| window.Get<Hyperlink>("Home_link").Click(); | |
| OpenAppBar(); | |
| window.Get<Hyperlink>("MyPlaces_link").Click(); | |
| var tile = window.Get<GroupBox>("CommonJS_UI_ResponsiveListView_Cluster1_Content_ListView2AddTile"); | |
| tile.Click(); |
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
| private static void BrokenDynamic() | |
| { | |
| IFoo foo = new Foo(); | |
| var method = typeof(IFoo).GetMethod("Bar"); | |
| string d = "test"; | |
| method.Invoke(foo, new[]{d}); | |
| } |
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
| public class DomainClass | |
| { | |
| public DomainClass(AnotherDomainClass dep, string arg){ | |
| //logic | |
| } | |
| } | |
| public class AnotherDomainClass{ | |
| public AnotherDomainClass(string arg, string arg2){ | |
| //ctor logic |
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
| public class Foo : IFoo | |
| { | |
| public Foo(string state, ISomeDepedency dep){} | |
| } | |
| public interface IFooFactory | |
| { | |
| IFoo Create(string state); | |
| } |
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
| [TestMethod] | |
| public async Task TestLocationSearchHasResult() | |
| { | |
| var testVm = new GeocodeViewModel { SearchText = "Springerstraat Amersfoort Netherlands" }; | |
| await Deployment.Current.Dispatcher.InvokeTaskAsync(() => testVm.SearchLocation()); | |
| Assert.IsTrue(testVm.MapLocations.Any()); | |
| } | |
| public static class DispatcherExtensions | |
| { |
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
| public class DelegateCommand : DelegateCommand<object> | |
| { | |
| public DelegateCommand(Action executeMethod) | |
| : base(o => executeMethod()) | |
| { | |
| } | |
| public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod) | |
| : base(o => executeMethod(), o => canExecuteMethod()) | |
| { |
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
| public interface IRaiseCanExecuteChanged | |
| { | |
| void RaiseCanExecuteChanged(); | |
| } | |
| // And an extension method to make it easy to raise changed events | |
| public static class CommandExtensions | |
| { | |
| public static void RaiseCanExecuteChanged(this ICommand command) | |
| { |