public void TestInitialize() { Asset testAsset = new Asset(TEMP_ID, TEMP_TITLE); testAsset.ChangeData(TEMP_DATA); Asset storeAsset = new Asset(TEMP_BAD_TITLE, TEMP_TITLE); _mockAssetRepo = new Mock<IAssetRepository>(); _mockAssetRepo.SetupAllProperties(); _mockAssetRepo.Setup(x => x.Find(TEMP_ID)).Returns(testAsset); _mockAssetRepo.Setup(x => x.Find(TEMP_BAD_ID)).Throws(new DaoNotFoundException()); _mockAssetRepo.Setup(x => x.Store(It.Is<Asset>(d => d.Name == TEMP_BAD_TITLE))).Throws(new Exception("Bad repository exception.")); _mockAssetRepo.Setup(x => x.Store(It.Is<Asset>(d => d.Content.Data == TEMP_BAD_DATA))).Throws(new Exception("Bad repository exception.")); _assetService = new AssetService(_mockAssetRepo.Object); }