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

            // 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?displayType=summary") },
                            Configuration = new HttpConfiguration()
                        }; 
            
            // Act 
            var assetListing = await _ctrl.GetAll("summary") as OkNegotiatedContentResult<IQueryable<AssetSummaryVm>>;
            

            // Assert
            Assert.IsNotNull(assetListing);
            Assert.That(assetListing.Content.Count(), Is.GreaterThanOrEqualTo(2));
            Assert.IsTrue(assetListing.Content.ElementAt(0).CurrentInvestor == _mockIdentitySvc.Object.CurrentUser);
            Assert.IsTrue(assetListing.Content.ElementAt(1).CurrentInvestor == _mockIdentitySvc.Object.CurrentUser);
           
        }