Ejemplo n.º 1
0
        public void ReaderIdIsNull()
        {
            // Arrange
            var        mock    = new Mock <IUnitOfWork>();
            LibService service = new LibService(mock.Object);

            // Act and assert
            Assert.ThrowsException <System.ArgumentNullException>(() => service.GetReader(null));
        }
Ejemplo n.º 2
0
        public void ReaderIsNotFound()
        {
            // Arrange
            var mock = new Mock <IUnitOfWork>();

            mock.Setup(a => a.Readers.Get(1)).Returns((Reader)null);
            LibService service = new LibService(mock.Object);

            // Act and assert
            Assert.ThrowsException <System.InvalidOperationException>(() => service.GetReader(1));
        }