Exemplo n.º 1
0
        public void GetByIdTestBad()
        {
            MockDb.Setup(x => x.SingleById <FileStore>(1)).Throws(new Exception());

            var results = FileStore.GetById(MockDb.Object, 1);

            Assert.IsFalse(results.Success);
        }
Exemplo n.º 2
0
        public void GetByIdTest()
        {
            MockDb.Setup(x => x.SingleById <FileStore>(1)).Returns(new FileStore()
            {
                FileStoreId = 100
            });

            var results = FileStore.GetById(MockDb.Object, 1);

            Assert.AreEqual(100, results.Item.FileStoreId);
        }