public void GetRecordById_WhenCalledCorrectly_Succeeds() { // Assemble var recordRepository = new Mock <IRecordRepository>(); recordRepository.Setup(a => a.FindById(It.IsAny <long>())) .Returns(RecordMapper.ToEntity(SampleData.SampleRecordData.ValidSampleRecord1())); // Act var record = recordRepository.Object.FindById(1); // Assert Assert.NotNull(record); }
public void FindAll_WhenCalledCorrectly_Succeeds() { // Assemble var recordRepository = new Mock <IRecordRepository>(); recordRepository.Setup(a => a.FindAll()) .Returns(new List <RecordEntity> { RecordMapper.ToEntity(SampleData.SampleRecordData.ValidSampleRecord1()) }); // Act var records = recordRepository.Object.FindAll(); // Assert Assert.NotNull(records); }
public void Update(RecordModel entity) { _recordRepository.Update(RecordMapper.ToEntity(entity)); }