コード例 #1
0
        public void Initialize()
        {
            meetingDataA = new MeetingData("AA", "AA", "2005-03-05 22:12", 10);
            meetingDataB = new MeetingData("BB", "BB", "2005-04-05 22:12", 10);
            meetingDataC = new MeetingData("CC", "CC", "2005-05-05 22:12", 10);
            meetingDataD = new MeetingData("DD", "DD", "2005-06-05 22:12", 10);

            localMeetingsRepository = new MeetingsServiceLib.LocalMeetingsRepository();
            service = new MeetingsServiceLib.Service(localMeetingsRepository, null, null);
        }
コード例 #2
0
        public void GetMeetingParticipantsWhenLackOfParticipant()
        {
            var meetingData = new MeetingData("AA", "AA", "2005-03-05 22:12", 10);

            service.addMeeting(meetingData.Name, meetingData.Location, meetingData.Date, meetingData.MaxNumberOfParticipants);

            var expectedUserList = new List <User> {
            };

            CollectionAssert.AreEqual(expectedUserList, service.getMeetingParticipants(meetingData.Name));
        }
コード例 #3
0
        public void SignUserTwiceOnTheSameMeetingIsNotPosible()
        {
            var meetingData = new MeetingData("AA", "AA", "2005-03-05 22:12", 10);
            var userDataA   = new UserData("Jan", "Kowalski", "jankow", "*****@*****.**");

            service.addMeeting(meetingData.Name, meetingData.Location, meetingData.Date, meetingData.MaxNumberOfParticipants);
            service.addUser(userDataA.Name, userDataA.Surname, userDataA.Login, userDataA.Email);

            service.signUpUserToMeeting(userDataA.Login, meetingData.Name);
            service.signUpUserToMeeting(userDataA.Login, meetingData.Name);

            var expectedUserList = new List <User> {
                userDataA.convertToUser()
            };

            CollectionAssert.AreEqual(expectedUserList, service.getMeetingParticipants(meetingData.Name));
        }
コード例 #4
0
        public void GetUsersMeeting()
        {
            var userData = new UserData("Jan", "Kowalski", "jankow", "*****@*****.**");

            var meetingDataA = new MeetingData("AA", "AA", "2005-03-05 22:12", 10);
            var meetingDataB = new MeetingData("BB", "BB", "2005-04-05 22:12", 10);

            service.addUser(userData.Name, userData.Surname, userData.Login, userData.Email);
            service.addMeeting(meetingDataA.Name, meetingDataA.Location, meetingDataA.Date, meetingDataA.MaxNumberOfParticipants);
            service.addMeeting(meetingDataB.Name, meetingDataB.Location, meetingDataB.Date, meetingDataB.MaxNumberOfParticipants);

            service.signUpUserToMeeting(userData.Login, meetingDataA.Name);
            service.signUpUserToMeeting(userData.Login, meetingDataB.Name);

            var expectedMeetingList = new List <Meeting>
            {
                meetingDataA.convertToMeeting(),
                meetingDataB.convertToMeeting()
            };

            CollectionAssert.AreEqual(expectedMeetingList, service.getUserMeetings(userData.Login));
        }