コード例 #1
0
        public void AttendTest01()
        {
            //Arrange
            //データの準備
            var testPersons  = PrepareData01();
            var personHolder = new PersonHolder(testPersons);
            //期待値
            var expected = new List <Person>
            {
                testPerson01,
                testPerson05,
                testPerson02,
                testPerson06
            };

            //参加メンバーのIDをリストにセット
            var idList = new List <string>
            {
                "test01",
                "test05"
            };

            //Act
            //実行
            personHolder.Attend(idList);

            //Assert
            Assert.Empty(expected.Except(personHolder.GetAttended()));
            Assert.Empty(personHolder.GetAttended().Except(expected));
        }
コード例 #2
0
        public void GetAttendedPersonsTest02()
        {
            //Arrange
            //データの準備
            var emptyPersons = new List <Person>();
            var personHolder = new PersonHolder(emptyPersons);

            //Act
            //実行
            var actual = personHolder.GetAttended();

            //Assert
            Assert.Empty(actual);
        }
コード例 #3
0
        public void Cancelest01()
        {
            //Arrange
            //データの準備
            var personHolder = new PersonHolder(PrepareData01());
            //期待値
            var expected = new List <Person>
            {
                testPerson02,
            };

            //参加を取り消すメンバーのIDをリストにセット
            var idList = new List <string> {
                "test06"
            };

            //Act
            //実行
            personHolder.Cancel(idList);

            //Assert
            Assert.Empty(expected.Except(personHolder.GetAttended()));
            Assert.Empty(personHolder.GetAttended().Except(expected));
        }
コード例 #4
0
        public void GetAttendedPersonsTest01()
        {
            //Arrange
            //データの準備
            var personHolder = new PersonHolder(PrepareData01());
            //期待値
            var expected = new List <Person>
            {
                testPerson02,
                testPerson06
            };

            //Act
            //実行
            var actual = personHolder.GetAttended();

            //Assert
            Assert.Empty(expected.Except(actual));
            Assert.Empty(actual.Except(expected));
        }