main
1using developwithpassion.bdd.contexts;
2using Gorilla.Commons.Infrastructure.FileSystem;
3using Gorilla.Commons.Testing;
4using MoMoney.Presentation.Model.Projects;
5using momoney.presentation.views;
6
7namespace momoney.presentation.model.menu.file
8{
9 [Concern(typeof (SaveAsCommand))]
10 public class when_saving_the_current_project_to_a_new_file_path : concerns_for<ISaveAsCommand, SaveAsCommand>
11 {
12 it should_save_the_current_project_to_the_new_path = () => current_project.was_told_to(x => x.save_project_to(new_path));
13
14 context c = () =>
15 {
16 current_project = an<IProjectController>();
17 view = an<ISelectFileToSaveToDialog>();
18 new_path = "blah_blah";
19
20 when_the(view).is_told_to(x => x.tell_me_the_path_to_the_file()).it_will_return(new_path);
21 };
22
23 because b = () => sut.run();
24
25 public override ISaveAsCommand create_sut()
26 {
27 return new SaveAsCommand(view, current_project);
28 }
29
30 static IProjectController current_project;
31 static ApplicationFile new_path;
32 static ISelectFileToSaveToDialog view;
33 }
34}