Esempio n. 1
0
        public void SignUserToMeetoingWithoutFreePlacesIsNotPosible()
        {
            var meetingData = new MeetingData("AA", "AA", "2005-03-05 22:12", 1);
            var userDataA   = new UserData("Jan", "Kowalski", "jankow", "*****@*****.**");
            var userDataB   = new UserData("Adam", "Mrozek", "mrozek", "*****@*****.**");

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

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

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

            Assert.IsTrue(checkIfUsersListAreEqual(expectedUserList, service.getMeetingParticipants(meetingData.Name).ToList()));

            service.removeUser(userDataA.Login);
            service.removeUser(userDataB.Login);

            service.removeMeeting(meetingData.Name);
        }
Esempio n. 2
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 <MeetingService.Meeting>
            {
                meetingDataA.convertToMeeting(),
                meetingDataB.convertToMeeting()
            };

            var i = service.getUserMeetings(userData.Login).ToList();

            Assert.IsTrue(checkIfListOfMeetingAreEqual(expectedMeetingList, service.getUserMeetings(userData.Login).ToList()));

            service.removeUser(userData.Login);

            service.removeMeeting(meetingDataA.Name);
            service.removeMeeting(meetingDataB.Name);
        }
Esempio n. 3
0
        public void GetMeetingParticipantsWhenLackOfParticipant()
        {
            var meetingDataA = new MeetingData("AA", "AA", "2005-03-05 22:12", 10);

            service.addMeeting(meetingDataA.Name, meetingDataA.Location, meetingDataA.Date, meetingDataA.MaxNumberOfParticipants);
            Assert.AreEqual(0, service.getMeetingParticipants(meetingDataA.Name).ToList().Count);
            service.removeMeeting(meetingDataA.Name);
        }
Esempio n. 4
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);

            service = new MeetingService.WebInterface();
        }