public async Task AddCalendarNote_Invalid() { #region Create_Mapper_DatabaseSettings_And_Initialization_Of_ApiHelper var config = new MapperConfiguration(opts => {}); var mapper = config.CreateMapper(); var apiHelper = new ApiHelper(mapper, settings); #endregion #region Data_To_Database CalendarNote calendarNote = new CalendarNote { Date = new Date { Day = DateTime.Now.Day.ToString(), Month = DateTime.Now.Month.ToString(), Year = DateTime.Now.Year.ToString(), Minute = DateTime.Now.Minute.ToString(), Hour = DateTime.Now.Hour.ToString() }, FamilyId = familyId, Message = "message", }; #endregion #region Test_Method var result = await apiHelper.AddCalendarNote(calendarNote, "1e8e007f3959cc26088ffb86"); Assert.Null(result); #endregion }
public async Task AddCalendarNote() { #region Create_Mapper_DatabaseSettings_And_Initialization_Of_ApiHelper var config = new MapperConfiguration(opts => {}); var mapper = config.CreateMapper(); var apiHelper = new ApiHelper(mapper, settings); #endregion #region Data_To_Database CalendarNote calendarNote = new CalendarNote { Date = new Date { Day = DateTime.Now.Day.ToString(), Month = DateTime.Now.Month.ToString(), Year = DateTime.Now.Year.ToString(), Minute = DateTime.Now.Minute.ToString(), Hour = DateTime.Now.Hour.ToString() }, FamilyId = familyId, Message = "message", }; #endregion #region Test_Method var result = await apiHelper.AddCalendarNote(calendarNote, psyId); Assert.NotNull(result); Assert.Equal("message", result.Message); Assert.Equal(psyId, result.UserId); Assert.Equal(DateTime.Now.Day.ToString(), result.Date.Day); Assert.Equal(DateTime.Now.Month.ToString(), result.Date.Month); Assert.Equal(DateTime.Now.Year.ToString(), result.Date.Year); Assert.Equal(DateTime.Now.Minute.ToString(), result.Date.Minute); Assert.Equal(DateTime.Now.Hour.ToString(), result.Date.Hour); #endregion }