public void CreateMinutesOfMeeting() { // In-memory database only exists while the connection is open var connection = new SqliteConnection("DataSource=:memory:"); connection.Open(); try { var options = new DbContextOptionsBuilder <ScrumContext>() .UseSqlite(connection) .Options; // Create the schema in the database using (var context = new ScrumContext(options)) { context.Database.EnsureCreated(); } // Run the test against one instance of the context using (var context = new ScrumContext(options)) { var service = new GroupRepository(context); MeetingNotes notes = new MeetingNotes(); notes.SprintId = 1; notes.dailyMeeting = "DAILY TEST"; bool created = service.CreateMinutesOfMeeting(notes); Assert.AreEqual(true, created); Assert.AreEqual(1, context.MeetingNoteses.Count()); Assert.AreEqual("DAILY TEST", context.MeetingNoteses.Find(1).DailyMeeting); } } finally { connection.Close(); } }
public bool addMeetingNotes(MeetingNotes meetingNotes) { return(_groupRepository.CreateMinutesOfMeeting(meetingNotes)); }