/// <summary> /// This is a sandbox for devs to use. Useful for directly calling some library without needing to launch the main application /// </summary> /// <param name="args"></param> private static void Main(string[] args) { StructureMapBootStrapper.ConfigureDependencies(StructureMapBootStrapper.DependencyType.LIVE); //set to either "test" or "dev" KwasantDbContext db = new KwasantDbContext(); db.Database.Initialize(true); var evDO = new EventDO(); evDO.CreatedBy = new UserDO { EmailAddress = new EmailAddressDO { Name = "Alex Edelstein" } }; evDO.Description = @"Meeting with Paul Maeder, Campaign co-chair for the School of Engineering and Applied Sciences."; evDO.Attendees.Add(new AttendeeDO { Name = "Alex Edelstein", EmailAddress = new EmailAddressDO("*****@*****.**") }); evDO.Attendees.Add(new AttendeeDO { Name = "Dieterich, Joshua Ethan", EmailAddress = new EmailAddressDO("*****@*****.**") }); evDO.Attendees.Add(new AttendeeDO { Name = "Outbound Archive", EmailAddress = new EmailAddressDO("*****@*****.**") }); evDO.Attendees.Add(new AttendeeDO { Name = "'*****@*****.**'", EmailAddress = new EmailAddressDO("*****@*****.**") }); evDO.StartDate = new DateTimeOffset(2014, 12, 09, 16, 0, 0, 0, TimeSpan.FromHours(-8)); evDO.EndDate = evDO.StartDate.AddHours(1); evDO.Location = "Harvard"; evDO.Summary = "Harvard Meeting with Paul Maeder"; var cal = Event.GenerateICSCalendarStructure(evDO); iCalendarSerializer serializer = new iCalendarSerializer(cal); string fileToAttach = serializer.Serialize(cal); }
public void CopyFrom(EventDO eventDO) { //We can't called GetType() because EF mocks our object PropertyInfo[] props = typeof(EventDO).GetProperties(); foreach (PropertyInfo prop in props) { prop.SetValue(this, prop.GetValue(eventDO)); } }
public void Event_Dispatch_CanSendICS() { EventRepository eventRepo = new EventRepository(_uow); AttendeeRepository attendeesRepo = new AttendeeRepository(_uow); List<AttendeeDO> attendees = new List<AttendeeDO> { _fixture.TestAttendee1(), _fixture.TestAttendee2() }; attendees.ForEach(attendeesRepo.Add); EventDO eventDO = new EventDO { Description = "This is my test invitation", Summary = @"My test invitation", Location = @"Some place!", StartDate = DateTime.Today.AddMinutes(5), EndDate = DateTime.Today.AddMinutes(15), Attendees = attendees, Emails = new List<EmailDO>() }; eventRepo.Add(eventDO); Calendar.DispatchEvent(_uow, eventDO); //Verify success //use imap to load unread messages from the test customer account //verify that one of the messages is a proper ICS message //retry every 15 seconds for 1 minute //create an Email message addressed to the customer and attach the file. //skip for v.1: add EmailID to outbound queue }
public RazorViewModel(EventDO ev, String userID, String authTokenURL) { IsAllDay = ev.IsAllDay; StartDate = ev.StartDate.DateTime; EndDate = ev.EndDate.DateTime; Summary = ev.Summary; Description = ev.Description; Location = ev.Location; AuthTokenURL = authTokenURL; Attendees = ev.Attendees.Select(a => new RazorAttendeeViewModel { Name = a.Name, EmailAddress = a.EmailAddress.Address }).ToList(); UserID = userID; }
private bool EventHasChanged(IUnitOfWork uow, EventDO eventDO) { //Stub method for now return true; }