Exemplo n.º 1
0
            public void ViewModel_is_described()
            {
                modelSpecification = new ModelSpecification();
                var loginViewModel = new ViewModel("Login");

                loginViewModel.AddProperty(new ViewModelProperty("Username", "string", false));
                loginViewModel.AddProperty(new ViewModelProperty("Password", "string", false));
                loginViewModel.AddCommand(new ViewModelCommand("Login"));
                modelSpecification.AddViewModel(loginViewModel);

                var mainScreenViewModel = new ViewModel("MainScreen");

                mainScreenViewModel.AddProperty(new ViewModelProperty("Title", "string", true));
                modelSpecification.AddViewModel(mainScreenViewModel);
            }
Exemplo n.º 2
0
        private void ParseViewModelName()
        {
            var nameToken = CurrentToken();

            semanticModel = new ViewModel(nameToken.Value);
            modelSpecification.AddViewModel(semanticModel);
        }
            public void Setup()
            {
                Given(VisualStudioSolution_exists);
                And("ViewModel is described", () =>
                {
                    mvvmSpecification = new ModelSpecification();
                    mvvmSpecification.AddViewModel(new ViewModel("Login"));
                });
                And(ControllersConvention_is_created);

                When("apply Convention", () =>
                     convention.Apply(mvvmSpecification, mvvmFile));
            }
Exemplo n.º 4
0
            public void Setup()
            {
                Given(VisualStudio_Solution_exists);
                And(Solution_has_a_UnitTest_Project);
                And("ViewModel is described", () =>
                {
                    mvvmDefinition = new ModelSpecification();
                    mvvmDefinition.AddViewModel(new ViewModel("Login"));
                });
                And(UnitTestConvention_is_created);

                When("apply Convention", () =>
                     convention.Apply(mvvmDefinition, mvvmFile));
            }
Exemplo n.º 5
0
            public void Setup()
            {
                Given(ViewsConvention_is_created);
                And(Solution_is_created);
                And("ViewModel is described", () =>
                {
                    mvvmDefinition     = new ModelSpecification();
                    var loginViewModel = new ViewModel("Login");
                    loginViewModel.AddProperty(new ViewModelProperty("Username", "String", false));
                    loginViewModel.AddProperty(new ViewModelProperty("Password", "String", false));
                    loginViewModel.AddCommand(new ViewModelCommand("Login"));
                    mvvmDefinition.AddViewModel(loginViewModel);
                });

                When(ApplyConvention);
            }
Exemplo n.º 6
0
            public void Setup()
            {
                Given(VisualStudio_Solution_exists);
                And(Solution_has_a_UnitTest_Project);
                And("Project has a .mvvm file deep in the tree", () =>
                {
                    mvvmFile = project.NewFolder("Test").NewFolder("SubFolder").NewFolder("ViewModel").NewFile("viewmodel.mvvm");
                });
                And("ViewModel is described", () =>
                {
                    mvvmDefinition = new ModelSpecification();
                    mvvmDefinition.AddViewModel(new ViewModel("EditUserViewModel"));
                });
                And(UnitTestConvention_is_created);

                When("apply Convention", () =>
                     convention.Apply(mvvmDefinition, mvvmFile));
            }
Exemplo n.º 7
0
            public void Setup()
            {
                Given(ViewsConvention_is_created);
                And(Solution_is_created);
                And("Project has 'Views' folder and Views", () =>
                {
                    var viewsFolder = project.NewFolder("Views");

                    viewsFolder.NewFile("Login.xaml");
                });
                And("ViewModel is described", () =>
                {
                    mvvmDefinition     = new ModelSpecification();
                    var loginViewModel = new ViewModel("Login");
                    loginViewModel.AddProperty(new ViewModelProperty("Username", "String", false));
                    loginViewModel.AddProperty(new ViewModelProperty("Password", "String", false));
                    loginViewModel.AddCommand(new ViewModelCommand("Login"));
                    mvvmDefinition.AddViewModel(loginViewModel);
                });

                When(ApplyConvention);
            }