Ejemplo n.º 1
0
        public void VisibilityOfHintLabel_2()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali had type something in the search box
            And Ali clear the searches after that
            Then Ali shall not see the HintLabel
                ";
            var input = new SubjectListModel(SubjectModel.Parse(TestData.TestSlots));

            input.Search("something");
            input.Search("");
            Assert.IsFalse(input.IsHintLabelVisible, expectedBehaviour);
        }
Ejemplo n.º 2
0
        public void SuggestiveText_3()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali search for 'bahsa'
            And Ali clear the searches after that
            Then Ali shall not see any suggestion
                ";
            var input = new SubjectListModel(SubjectModel.Parse(TestData.TestSlots));

            input.Search("bahsa");
            input.Search("");
            Assert.IsFalse(input.IsFeedbackPanelVisible, expectedBehaviour);
        }
Ejemplo n.º 3
0
        public void ErrorLabel_2()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali search for 'some random text lol lol lol'
            And Ali clear searches after that
            Then Ali shall not see any suggestion
            And Ali shall not see the error message anymore 
                ";
            var input = new SubjectListModel(SubjectModel.Parse(TestData.TestSlots));

            input.Search("some random text lol lol lol");
            input.Search("");
            Assert.IsFalse(input.IsErrorLabelVisible, expectedBehaviour);
        }
Ejemplo n.º 4
0
        public void NavigatingAfterSearching_3()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali searched for 'Bahasa'
            And Ali press Down Key
            And Ali clear the searches
            Then Ali shall see that only ONE subject in the list is highlighted
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);
            var input  = new SubjectListModel(models);

            input.Search("Bahasa");
            input.NavigateToNextSubjectCommand.Execute(null);
            input.Search("");
            Assert.IsTrue(models.Count(x => x.IsFocused) == 1, expectedBehaviour);
        }
Ejemplo n.º 5
0
        public void SuggestiveText_2()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali search for 'bahsa'
            Then Ali shall see a suggestion suggesting 'Bahasa'
                ";
            var input = new SubjectListModel(SubjectModel.Parse(TestData.TestSlots));

            input.Search("bahsa");
            Assert.IsTrue(input.SuggestedText == "Bahasa", expectedBehaviour);
        }
Ejemplo n.º 6
0
        public void FilterSubject()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali search for 'ASSD'
            Then Ali shall see only one subject is visible to him
                ";
            var input = new SubjectListModel(SubjectModel.Parse(TestData.TestSlots));

            input.Search("ASSD");
            Assert.IsTrue(input.NumberOfVisibleSubject() == 1, expectedBehaviour);
        }
Ejemplo n.º 7
0
        public void NavigatingAfterSearching_1()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali searched for 'Bahasa'
            Then Ali shall see that the FIRST matching subject in the list is highlighted
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);
            var input  = new SubjectListModel(models);

            input.Search("Bahasa");
            Assert.IsTrue(models.FindAll(x => x.Name.ToLower().Contains("Bahasa".ToLower()))[0].IsFocused, expectedBehaviour);
        }
Ejemplo n.º 8
0
        public void NavigatingAfterSearching_4()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali searched for the name of first subject in the list('ASSD')
            Then Ali shall see that the subject ('ASSD') is highlighted
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);
            var input  = new SubjectListModel(models);

            input.Search("ASSD".ToLower());
            Assert.IsTrue(models.Find(x => x.CodeAndNameInitials.Contains("ASSD")).IsFocused
                          , expectedBehaviour);
        }
Ejemplo n.º 9
0
        public void NavigatingAfterSearching_2()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali searched for 'Bahasa'
            And Ali press Down Key
            Then Ali shall see that the SECOND matching subject in the list is highlighted
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);
            var input  = new SubjectListModel(models);

            input.Search("Bahasa");
            input.NavigateToNextSubjectCommand.Execute(null);
            Assert.IsTrue(models.FindAll(x => x.Name.ToLower().Contains("Bahasa".ToLower()))[1].IsFocused, expectedBehaviour);
        }
Ejemplo n.º 10
0
        public void SelectSubjectByPressingEnter()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali searched for the name of first subject in the list('ASSD')
            And Ali pressed Enter  
            Then Ali shall see that the first subject in the list is selected
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);
            var input  = new SubjectListModel(models, Permutator.Run_v2_withoutConsideringWeekNumber, new TaskRunnerForUnitTesting());

            input.Search("ASSD".ToLower());
            input.ToggleSelectionOnCurrentFocusedSubject();
            Assert.IsTrue(models.Find(x => x.CodeAndNameInitials.Contains("ASSD")).IsSelected
                          , expectedBehaviour);
        }
Ejemplo n.º 11
0
        public void Focusing_TestingForBug()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali search for random text that results in no matching subject
            And Ali press arrow keys (Up or Down)
            Then Ali shall not crash the application
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);
            var input  = new SubjectListModel(models);

            input.Search("qlkehj j2f2gkjg4");
            input.NavigateToNextSubjectCommand.Execute(null);
            input.NavigateToPreviousSubjectCommand.Execute(null);
            Assert.Pass(expectedBehaviour);
        }
Ejemplo n.º 12
0
        public void DisplayMode_3()
        {
            string expectedBehaviour =
                @"
            Given Ali just loaded slots data (by logging in)
            When Ali selected 1 subject
            And Ali clicked 'Show selected subject'
            And Ali start to type something in the search box
            Then Ali shall see all the subjects 
                ";
            var models = SubjectModel.Parse(TestData.TestSlots);

            models[0].IsSelected = true;
            var input = new SubjectListModel(models);

            input.ToggleDisplayModeCommand.Execute(null);
            input.Search("");
            Assert.IsTrue(input.NumberOfVisibleSubject() == models.Count, expectedBehaviour);
        }