Пример #1
0
        public void MyProfileEdditorTest5()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "Vova"
            };


            MyProfileEdditor.AddMessage(profile, "fdsgds", "123");
        }
Пример #2
0
        public void MyProfileEdditorTest2()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "Vova"
            };


            MyProfileEdditor.AddMessage(profile, "40", "123");

            Assert.That("2412Vova : \n 123 \n", Is.EqualTo(profile.MyContacts[0].MessageHistory));

            Assert.That(1, Is.EqualTo(MyProfileEdditor.FindIndex(contactList, "42")));
            Assert.That(0, Is.EqualTo(MyProfileEdditor.FindIndex(contactList, "40")));
        }
Пример #3
0
        public void MyProfileEdditorTest4()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            var profile = new MyProfile
            {
                MyContacts = contactList,
                MyName     = "Vova"
            };


            MyProfileEdditor.ChangeStatus(profile, "esfs", false);

            Assert.True(profile.MyContacts[0].Online);

            MyProfileEdditor.DeleteContact(profile, "fdsgds");

            Assert.That(2, Is.EqualTo(profile.MyContacts.Count));
        }
Пример #4
0
        public void MyProfileEdditorTest1()
        {
            var student = new Contact
            {
                MessageHistory = "2412",
                Name           = "40",
                Online         = true
            };

            var student2 = new Contact
            {
                MessageHistory = "2412",
                Name           = "42",
                Online         = true
            };

            var contactList = new List <Contact> {
                student, student2
            };

            Assert.That(0, Is.EqualTo(MyProfileEdditor.FindIndex(contactList, "40")));
        }