public void GetByIdTestBad() { MockDb.Setup(x => x.SingleById <FileStore>(1)).Throws(new Exception()); var results = FileStore.GetById(MockDb.Object, 1); Assert.IsFalse(results.Success); }
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); }