예제 #1
0
        public void EventDTOTest()
        {
            Location location = new Location()
            {
                Name = "asdf",
                Address = "zxvc",
                LocationID = 1
            };

            Activity activity = new Activity()
            {
                ActivityID = 1,
                Name = "asdf",
                DayOfWeek = "Thursday",
                PreferredTime = new TimeSpan(1),
                Location = location
            };

            User user = new User()
            {
                Name = "kevin"
            };

            Guest guest = new Guest()
            {
                Name = "kevin",
                Host = user
            };

            Event ev = new Event()
            {
                Activity = activity,
                ActivityID = activity.ActivityID,
                UsersInEvent = new List<User>()
                {
                    user
                },
                GuestsInEvent = new List<Guest>()
                {
                    guest
                },
                DateTime = new DateTime(),
                EventID = 1,
                Name = "asdf"
            };

            var dto = new EventDTO(ev);

            AssertEventDTO(ev, dto);

            Assert.AreEqual(1, dto.UsersInEvent.Count());
            Assert.AreEqual(1, dto.GuestsInEvent.Count());
        }
예제 #2
0
 public UserDTO(User user)
     : base(user)
 {
     Name = user.GetName();
 }