main
 1using developwithpassion.bdd.contexts;
 2using Gorilla.Commons.Testing;
 3using momoney.presentation.views;
 4using momoney.service.infrastructure.logging;
 5
 6namespace momoney.presentation.presenters
 7{
 8    public class behaves_like_log_file_presenter : concerns_for<ILogFilePresenter, LogFilePresenter>
 9    {
10        context c = () =>
11        {
12            view = the_dependency<ILogFileView>();
13            tasks = the_dependency<ILogFileTasks>();
14        };
15
16        static protected ILogFileView view;
17        static protected ILogFileTasks tasks;
18    }
19
20    public class when_displaying_the_log_file : behaves_like_log_file_presenter
21    {
22        it should_display_the_contents_of_the_log_file = () => view.was_told_to(x => x.display(log_file_path));
23
24        context c = () =>
25        {
26            log_file_path = "log.txt";
27            log_file_contents = "hello_jello";
28            tasks.is_told_to(x => x.get_the_path_to_the_log_file()).it_will_return(log_file_path);
29            tasks.is_told_to(x => x.get_the_contents_of_the_log_file()).it_will_return(log_file_contents);
30        };
31
32        because b = () => sut.run();
33
34        static string log_file_contents;
35        static string log_file_path;
36    }
37}