Ejemplo n.º 1
0
        // ReSharper disable once InconsistentNaming
        public async Task Controller_Can_DELETE_a_Fake_Asset_for_an_investor() {

            // Arrange - see above business rules
            _ctrl = new AssetController(_mockRepo.Object, _mockIdentitySvc.Object, _mockRepoInvestor.Object, _mockRepoAssetClass.Object, _mockRepoProfile.Object, _mockRepoAcctType.Object, _mockRepoPosition.Object, _mockRepoIncome.Object) {
                    Request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/PIMS.Web.Api/api/Asset/AAPL") },
                    Configuration = new HttpConfiguration()
            };

            // Act 
            var response = await _ctrl.DeleteAsset("AAPL") as OkNegotiatedContentResult<IQueryable<Asset>>;
            

            // Assert
            Assert.IsNotNull(response);


        }
Ejemplo n.º 2
0
        // ReSharper disable once InconsistentNaming
        public async Task Controller_Can_not_GET_a_single_Fake_Asset_for_an_investor_using_an_invalid_ticker_symbol() {

            // Arrange
            _ctrl = new AssetController(_mockRepo.Object, _mockIdentitySvc.Object, _mockRepoInvestor.Object, _mockRepoAssetClass.Object, _mockRepoProfile.Object, _mockRepoAcctType.Object, _mockRepoPosition.Object, _mockRepoIncome.Object) {
                    Request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/PIMS.Web.Api/api/Asset/VNRX") },
                    Configuration = new HttpConfiguration()
            };

            // Act 
            //var assetListing = await _ctrl.GetByTicker("VNR") as OkNegotiatedContentResult<IQueryable<Asset>>;
            var assetListing = await _ctrl.DeleteAsset("VNRX") as OkNegotiatedContentResult<IQueryable<AssetSummaryVm>>;

            // Assert
            Assert.IsNull(assetListing);
        }