private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     myProjectInfoViewModel = DataContext as ProjectInfoViewModel;
     if (myProjectInfoViewModel != null)
     {
         myProjectInfoViewModel.LatestBuild.PropertyChanged +=
             LatestBuildViewModel_PropertyChanged;
         if (firstTimeLoad)
         {
             BuildStatusUpdate();
         }
     }
     firstTimeLoad = false;
 }
        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);
                });
            });
        }
 public void SetUp()
 {
     viewModel = new ProjectInfoViewModel();
 }