Ejemplo n.º 1
0
        public void Assure_status_is_updated_when_LatestBuild_is_overridden()
        {
             Scenario.StartNew(this, scenario =>
             {
                 scenario.Given(the_object_is_created_without_buildViewModel_status);
                 scenario.When("LatestBuild is set on projectInfroViewModel");
                 scenario.Then("status should change from unknown to the new latestbuild status", () =>
                 {
                     viewModel.Status.ShouldBe(BuildStatus.Unknown);

                     var buildViewModel = new BuildViewModel();
                     buildViewModel.Status = BuildStatus.Building;
                     ciViewModel.Data.Last().LatestBuild = buildViewModel;

                     viewModel.Status.ShouldBe(BuildStatus.Building);
                 });
             });
        }
Ejemplo n.º 2
0
        public void Assure_status_is_updated_when_data_is_added_to_civiewmodel()
        {
            Scenario.StartNew(this, scenario =>
            {
                scenario.Given(the_object_is_created_without_data);

                scenario.When("data is added to the civiewmodel");

                scenario.Then("status should change from successfull to the new projects buildstatus", () =>
                {
                    viewModel.Status.ShouldBe(BuildStatus.Unknown);
                    
                    var projectInfoViewModel = new ProjectInfoViewModel();
                    var buildViewModel = new BuildViewModel();
                    buildViewModel.Status = BuildStatus.Building;
                    projectInfoViewModel.LatestBuild = buildViewModel;
                    ciViewModel.Data.Add(projectInfoViewModel);

                    viewModel.Status.ShouldBe(BuildStatus.Building);
                });
            });
        }