main
1using Machine.Specifications;
2using presentation.windows;
3using presentation.windows.presenters;
4
5namespace unit.client.presenters
6{
7 [Subject(typeof(AddFamilyMemberPresenter))]
8 public class AddFamilyMemberPresenterSpecs
9 {
10 public class concern : Helpers
11 {
12 Establish context = () =>
13 {
14 command_builder = a<UICommandBuilder>();
15
16 sut = new AddFamilyMemberPresenter(command_builder);
17 };
18
19 static protected AddFamilyMemberPresenter sut;
20 static protected UICommandBuilder command_builder;
21 }
22
23 public class when_clicking_on_the_save_button : concern
24 {
25 It should_invoke_the_save_command = () =>
26 {
27 save_command.received(x => x.Execute(null));
28 };
29
30 Establish context = () =>
31 {
32 save_command = a<IObservableCommand>();
33
34 command_builder.is_told_to(x => x.build<AddFamilyMemberPresenter.SaveCommand>(sut)).it_will_return(save_command);
35 };
36
37 Because b = () =>
38 {
39 sut.present();
40 sut.Save.Execute(null);
41 };
42
43 static IObservableCommand save_command;
44 }
45 }
46}