public async Task EventDocumentER_TestLastUpdatedByMaxLengthExceeds255() { var eventDocumentObj = await EventDocumentER.NewEventDocumentER(); eventDocumentObj.Event = await EventEC.GetEventEC(new Event() { Id = 1 }); eventDocumentObj.DocumentName = "eventDocument name"; eventDocumentObj.PathAndFileName = "c:\\pathandfilename"; eventDocumentObj.LastUpdatedBy = "edm"; eventDocumentObj.LastUpdatedDate = DateTime.Now; var isObjectValid = eventDocumentObj.IsValid; eventDocumentObj.LastUpdatedBy = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor " + "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis " + "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. " + "Duis aute irure dolor in reprehenderit"; Assert.NotNull(eventDocumentObj); Assert.True(isObjectValid); Assert.False(eventDocumentObj.IsValid); Assert.Equal("LastUpdatedBy", eventDocumentObj.BrokenRulesCollection[0].Property); Assert.Equal("LastUpdatedBy can not exceed 255 characters", eventDocumentObj.BrokenRulesCollection[0].Description); }
private async Task BuildTaskForEvent(TaskForEventEC eventToBuild) { eventToBuild.Event = await EventEC.GetEventEC(new Event { Id = 1 }); eventToBuild.TaskName = "task description"; eventToBuild.PlannedDate = DateTime.Now; eventToBuild.ActualDate = DateTime.Now; eventToBuild.Information = "information"; eventToBuild.LastUpdatedBy = "edm"; eventToBuild.LastUpdatedDate = DateTime.Now; eventToBuild.Notes = "notes for doctype"; }
public async Task EventEC_LastUpdatedByRequired() { var eventObjToTest = BuildEvent(); var eventObj = await EventEC.GetEventEC(eventObjToTest); var isObjectValidInit = eventObj.IsValid; eventObj.LastUpdatedBy = string.Empty; Assert.NotNull(eventObj); Assert.True(isObjectValidInit); Assert.False(eventObj.IsValid); Assert.Equal("LastUpdatedBy", eventObj.BrokenRulesCollection[0].Property); }
public async Task EventEC_LastUpdatedDateRequired() { var eventObjToTest = BuildEvent(); var eventObj = await EventEC.GetEventEC(eventObjToTest); var isObjectValidInit = eventObj.IsValid; eventObj.LastUpdatedDate = DateTime.MinValue; Assert.NotNull(eventObj); Assert.True(isObjectValidInit); Assert.False(eventObj.IsValid); Assert.Equal("LastUpdatedDate", eventObj.BrokenRulesCollection[0].Property); Assert.Equal("LastUpdatedDate required", eventObj.BrokenRulesCollection[0].Description); }
public async Task EventEC_EventNameRequired() { var eventObjToTest = BuildEvent(); var eventObj = await EventEC.GetEventEC(eventObjToTest); var isObjectValidInit = eventObj.IsValid; eventObj.EventName = string.Empty; Assert.NotNull(eventObj); Assert.True(isObjectValidInit); Assert.False(eventObj.IsValid); Assert.Equal("EventName", eventObj.BrokenRulesCollection[0].Property); Assert.Equal("EventName required", eventObj.BrokenRulesCollection[0].Description); }
public async Task EventEC_GetEventEC() { var eventObjToLoad = BuildEvent(); var eventObj = await EventEC.GetEventEC(eventObjToLoad); Assert.NotNull(eventObj); Assert.IsType <EventEC>(eventObj); Assert.Equal(eventObjToLoad.Id, eventObj.Id); Assert.Equal(eventObjToLoad.Description, eventObj.Description); Assert.Equal(eventObjToLoad.LastUpdatedBy, eventObj.LastUpdatedBy); Assert.Equal(new SmartDate(eventObjToLoad.LastUpdatedDate), eventObj.LastUpdatedDate); Assert.Equal(eventObjToLoad.Notes, eventObj.Notes); Assert.Equal(eventObjToLoad.RowVersion, eventObj.RowVersion); Assert.True(eventObj.IsValid); }
public async Task EventEC_EventNameExceedsMaxLengthOf255Chars() { var eventObjToTest = BuildEvent(); var eventObj = await EventEC.GetEventEC(eventObjToTest); var isObjectValidInit = eventObj.IsValid; eventObj.EventName = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor " + "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis " + "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis " + "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis "; Assert.NotNull(eventObj); Assert.True(isObjectValidInit); Assert.False(eventObj.IsValid); Assert.Equal("EventName", eventObj.BrokenRulesCollection[0].Property); Assert.Equal("EventName can not exceed 255 characters", eventObj.BrokenRulesCollection[0].Description); }
private async Task BuildEventDocument(EventDocumentEC eventDocumentObj) { eventDocumentObj.DocumentName = "eventDocument name"; eventDocumentObj.Event = await EventEC.GetEventEC(new Event() { Id = 1 }); eventDocumentObj.DocumentType = await DocumentTypeEC.GetDocumentTypeEC(new DocumentType() { Id = 1 }); eventDocumentObj.Notes = "eventDocument notes"; eventDocumentObj.PathAndFileName = "C:\\pathandfilename"; eventDocumentObj.LastUpdatedBy = "edm"; eventDocumentObj.LastUpdatedDate = DateTime.Now; eventDocumentObj.Notes = "notes for eventdocument"; }
private async Task <EventMemberER> BuildEventMember() { var eventDocumentObj = await EventMemberER.NewEventMemberER(); eventDocumentObj.Event = await EventEC.GetEventEC(new Event() { Id = 1 }); eventDocumentObj.MemberInfo = await MemberInfoEC.GetMemberInfoEC(new MemberInfo() { Id = 1 }); eventDocumentObj.Role = "Organizer"; eventDocumentObj.LastUpdatedBy = "edm"; eventDocumentObj.LastUpdatedDate = DateTime.Now; eventDocumentObj.Notes = "notes for doctype"; return(eventDocumentObj); }
public async Task EventDocumentER_TestLastUpdatedDateRequired() { var eventDocumentObj = await EventDocumentER.NewEventDocumentER(); eventDocumentObj.Event = await EventEC.GetEventEC(new Event() { Id = 1 }); eventDocumentObj.DocumentName = "eventDocument name"; eventDocumentObj.PathAndFileName = "c:\\pathandfilename"; eventDocumentObj.LastUpdatedBy = "edm"; eventDocumentObj.LastUpdatedDate = DateTime.Now; var isObjectValid = eventDocumentObj.IsValid; eventDocumentObj.LastUpdatedDate = DateTime.MinValue; Assert.NotNull(eventDocumentObj); Assert.True(isObjectValid); Assert.False(eventDocumentObj.IsValid); Assert.Equal("LastUpdatedDate", eventDocumentObj.BrokenRulesCollection[0].Property); Assert.Equal("LastUpdatedDate required", eventDocumentObj.BrokenRulesCollection[0].Description); }
public async Task TaskForEventER_TestInsertNewTaskForEventER() { var eventObj = await TaskForEventER.NewTaskForEventER(); eventObj.TaskName = "event name"; eventObj.Notes = "This person is on standby"; eventObj.LastUpdatedBy = "edm"; eventObj.LastUpdatedDate = DateTime.Now; eventObj.PlannedDate = DateTime.Now; eventObj.ActualDate = DateTime.Now; eventObj.Information = "Information line"; var domainEvent = new Event() { Id = 1 }; eventObj.Event = await EventEC.GetEventEC(domainEvent); var savedTaskForEvent = await eventObj.SaveAsync(); Assert.NotNull(savedTaskForEvent); Assert.IsType <TaskForEventER>(savedTaskForEvent); Assert.True(savedTaskForEvent.Id > 0); }
public async Task EventDocumentER_TestInsertNewEventDocumentER() { var eventDocumentObj = await EventDocumentER.NewEventDocumentER(); eventDocumentObj.DocumentName = "eventDocument name"; eventDocumentObj.PathAndFileName = "c:\\pathandfilename"; eventDocumentObj.LastUpdatedBy = "edm"; eventDocumentObj.LastUpdatedDate = DateTime.Now; eventDocumentObj.Event = await EventEC.GetEventEC(new Event() { Id = 1 }); eventDocumentObj.DocumentType = await DocumentTypeEC.GetDocumentTypeEC(new DocumentType() { Id = 1 }); var savedEventDocument = await eventDocumentObj.SaveAsync(); Assert.NotNull(savedEventDocument); Assert.IsType <EventDocumentER>(savedEventDocument); Assert.True(savedEventDocument.Id > 0); }