Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void Update(RecordModel entity)
 {
     _recordRepository.Update(RecordMapper.ToEntity(entity));
 }