public void ReadSingleEntityAllNotNullTest() { _dataReader.Expect(x => x.IsDBNull(1)).Repeat.Once().Return(false); _dataReader.Expect(x => x.GetInt32(0)).Return(_device.Key).Repeat.Once(); _dataReader.Expect(x => x.GetString(1)).Return(_device.Name).Repeat.Once(); _dataReader.Expect(x => x.GetInt32(2)).Return(_device.TypeId).Repeat.Once(); _dataReader.Expect(x => x.GetInt32(3)).Return(_device.OwnerId).Repeat.Once(); _mockRepository.ReplayAll(); DevicesRepository devicesRepository = new DevicesRepository(_dbWrapper); Device actual = devicesRepository.ReadSingleEntity(_dataReader); Assert.AreEqual(_device.Key, actual.Key); Assert.AreEqual(_device.Name, actual.Name); Assert.AreEqual(_device.TypeId, actual.TypeId); Assert.AreEqual(_device.OwnerId, actual.OwnerId); _mockRepository.VerifyAll(); }