Esempio n. 1
0
        public void Test_MarkItem_ReturnsAStringEndingWIthCompleted()
        {
            //Arrange
            ViewModel viewmodel = new ViewModel();
            string value = "Meeting";

            //Act
            viewmodel.MarkitemCommand.Execute(value);

            //Assert
            //Assert.AreEqual()
        }
Esempio n. 2
0
        public void Test_ViewItems_ReturnsEmptyList_IfNoItemsAreInTheList()
        {
            //Arrange
            ViewModel viewmodel = new ViewModel();
            ObservableCollection<string> collection = new ObservableCollection<string>();

            //Act
            viewmodel.newList = collection;
            viewmodel.viewItemsCommand.Execute(null);

            //Assert
            Assert.AreEqual(0,viewmodel.newList.Count);
        }
Esempio n. 3
0
        public void Test_AddItem_AddsAnItemToTheListWhenGivenAnItem()
        {
            //Arrange
            ViewModel viewmodel = new ViewModel();
            string value = "meeting";
            ObservableCollection<string> expectedList = new ObservableCollection<string>()
            {
                value
            };

            //Act
            viewmodel.additemCommand.Execute(value);

            //Assert
            Assert.AreEqual(expectedList.Count , viewmodel.schedule.list.Count);
        }
Esempio n. 4
0
        public void Test_AddItem_AddsMoreThanOneItemWhenPassedMoreThanOneItem()
        {
            //Arrange
            ViewModel viewmodel = new ViewModel();
            string value = "meeting";
            string value2 = "lunch";
            ObservableCollection<string> expectedList = new ObservableCollection<string>()
            {
                value, value2
            };

            //Act
            viewmodel.additemCommand.Execute(value);
            viewmodel.additemCommand.Execute(value2);

            //Assert
            Assert.AreEqual(expectedList.Count, viewmodel.schedule.list.Count);
        }
Esempio n. 5
0
        public void Test_RemoveItemMethodwhenoneObjectIsInTheCollection_ReturnszerowhentheOnlyObjectIsRemoved()
        {
            //Arrange
            viewmodel = new ViewModel();

            string value = "meeting";

            expectedList = new ObservableCollection<string>()
            {
                value
            };
            expectedList.Remove(value);

            //Act
            viewmodel.additemCommand.Execute(value);
            viewmodel.RemoveitemCommand.Execute(value);

            //Assert
            Assert.AreEqual(expectedList.Count, viewmodel.newList.Count);
        }
Esempio n. 6
0
        public void Test_Test_RemoveItemMethodwhenTwoObjectsAreInTheCollection_ReturnsOnewhentheOnlyOneObjectIsRemoved()
        {
            //Arrange
            viewmodel = new ViewModel();
            string value = "meeting";
            string value2 = "Babbage meeting";
            expectedList = new ObservableCollection<string>()
            {
                value, value2
            };

            //Act
            //Adds two schedules to the expectedList and the actual list in the viewmodel
            viewmodel.additemCommand.Execute(value);
            viewmodel.additemCommand.Execute(value2);

            //Removes only one item
            expectedList.Remove(value);
            viewmodel.RemoveitemCommand.Execute(value);

            //Assert
            Assert.AreEqual(expectedList.Count, viewmodel.schedule.list.Count);
        }
Esempio n. 7
0
 public void Setup()
 {
     viewmodel = null;
     expectedList = null;
 }
Esempio n. 8
0
 public void CleanUp()
 {
     viewmodel = null;
     expectedList = null;
 }