public void DetailedItemViewModelTests_VisibleFields_MultipleEntitiesOfSameTime_ChangesAreReflectedInAllEntities()
        {
            var viewModel = new DetailedItemViewModel(_story);

            viewModel.InitializeAsync().Wait();

            var secondStory = StoryUtilities.CreateStory();

            try
            {
                var secondViewModel = new DetailedItemViewModel(_story);
                secondViewModel.InitializeAsync().Wait();

                ChangeFieldVisibility(viewModel, "Release", false);
                ChangeFieldVisibility(viewModel, "Committers", true);

                var expectedVisibleFields = viewModel.VisibleFields.Select(f => f.Name).OrderBy(f => f).ToList();
                var actualVisibleFields   = secondViewModel.FilteredEntityFields.Where(f => f.IsSelected).Select(f => f.Name).OrderBy(f => f).ToList();
                CollectionAssert.AreEqual(expectedVisibleFields, actualVisibleFields, "Mismathed visible fields");
            }
            finally
            {
                EntityService.DeleteById <Story>(WorkspaceContext, secondStory.Id);
            }
        }
Example #2
0
 public void ToolWindowHelperTests_ContextMenuForActiveItem_Story_Success()
 {
     ValidateContextMenuItems(StoryUtilities.CreateStory(),
                              new List <MenuItemEnum>
     {
         MenuItemEnum.ViewDetails,
         MenuItemEnum.OpenInBrowser,
         MenuItemEnum.StopWork,
         MenuItemEnum.CopyCommitMessage
     }, true, true);
 }
Example #3
0
        public void OctaneMyItemsViewModelTests_MyItems_Supported_Task_Success()
        {
            var story = StoryUtilities.CreateStory();

            try
            {
                ValidateType(TaskUtilities.CreateTask(story), 1);
            }
            finally
            {
                EntityService.DeleteById <Story>(WorkspaceContext, story.Id);
            }
        }
        public static void ClassInit(TestContext context)
        {
            _guid        = Guid.NewGuid();
            _story       = StoryUtilities.CreateStory("Story_" + _guid);
            _epic        = EpicUtilities.CreateEpic("Epic_" + _guid);
            _gherkinTest = TestGherkinUtilities.CreateGherkinTest("TestGherkin_" + _guid);

            _quotesGuid       = Guid.NewGuid();
            _storyQuote       = StoryUtilities.CreateStory("Story_\"_SingleQuote_" + _quotesGuid);
            _storyDoubleQuote = StoryUtilities.CreateStory("Story_\"\"_DoubleQuote_" + _quotesGuid);

            _refreshGuid        = Guid.NewGuid();
            _refreshStory       = StoryUtilities.CreateStory("Story_" + _refreshGuid);
            _refreshEpic        = EpicUtilities.CreateEpic("Epic_" + _refreshGuid);
            _refreshGherkinTest = TestGherkinUtilities.CreateGherkinTest("TestGherkin_" + _refreshGuid);
        }
Example #5
0
        public void ToolWindowHelperTests_ContextMenuForActiveItem_Task_Success()
        {
            var story = StoryUtilities.CreateStory();

            try
            {
                ValidateContextMenuItems(TaskUtilities.CreateTask(story),
                                         new List <MenuItemEnum>
                {
                    MenuItemEnum.ViewDetails,
                    MenuItemEnum.TaskViewParentDetails,
                    MenuItemEnum.OpenInBrowser,
                    MenuItemEnum.StopWork,
                    MenuItemEnum.CopyCommitMessage
                }, true, true);
            }
            finally
            {
                EntityService.DeleteById <Story>(WorkspaceContext, story.Id);
            }
        }
        public static void ClassInit(TestContext context)
        {
            _storyEntity       = StoryUtilities.CreateStory();
            _taskEntity        = TaskUtilities.CreateTask(_storyEntity);
            _gherkinTestEntity = TestGherkinUtilities.CreateGherkinTest();

            var viewModel = new OctaneMyItemsViewModel();

            viewModel.LoadMyItemsAsync().Wait();

            _storyViewModel = viewModel.MyItems.FirstOrDefault(i => i.ID == _storyEntity.Id && i.Entity.Name == _storyEntity.Name);
            Assert.IsNotNull(_storyViewModel, "Couldn't find story entity in MyWork");

            _taskViewModel = viewModel.MyItems.FirstOrDefault(i => i.ID == _taskEntity.Id && i.Entity.Name == _taskEntity.Name);
            Assert.IsNotNull(_taskViewModel, "Couldn't find task entity in MyWork");

            _gherkinTestViewModel = viewModel.MyItems.FirstOrDefault(i => i.ID == _gherkinTestEntity.Id && i.Entity.Name == _gherkinTestEntity.Name);
            Assert.IsNotNull(_gherkinTestViewModel, "Couldn't find gherkin entity in MyWork");

            Assert.IsNull(OctaneItemViewModel.CurrentActiveItem, "There shouldn't be an active item");
        }
 public static void ClassInit(TestContext context)
 {
     _story = StoryUtilities.CreateStory();
     _task  = TaskUtilities.CreateTask(_story);
 }
Example #8
0
 public void OctaneMyItemsViewModelTests_MyItems_Supported_Story_Success()
 {
     ValidateType(StoryUtilities.CreateStory(), 1);
 }
Example #9
0
 public static void ClassInit(TestContext context)
 {
     _addedStory     = StoryUtilities.CreateStory(null, false);
     _dismissedStory = StoryUtilities.CreateStory(null, false);
 }