예제 #1
0
        // ReSharper disable once InconsistentNaming
        public async Task Controller_Can_GET_All_Fake_Classifications() {
            // Arrange
            _ctrl = new AssetClassController(_mockRepo.Object) {
                Request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/PIMS.Web.Api/api/AssetClass") },
                Configuration = new HttpConfiguration()
            };

            // Act
            var classifications = await _ctrl.GetAll();

            // Assert
            Assert.IsNotNull(classifications);
            Assert.GreaterOrEqual(classifications.Count(), 9);
            Assert.That(classifications, Is.Ordered.By("Description"));
        }
        // ReSharper disable once InconsistentNaming
        public async Task Can_GET_All_Asset_Classifications()
        {
            // Arrange
            _ctrl = new AssetClassController(_repository) {
                Request = new HttpRequestMessage { RequestUri = new Uri(UrlBase + "/AssetClass") },
                Configuration = new HttpConfiguration()
            };
            

            // Act
            var classifications = await _ctrl.GetAll(); 


            // Assert
            Assert.IsNotNull(classifications);
            Assert.GreaterOrEqual(classifications.Count(), 15);
            Assert.That(classifications.First(x => x.LastUpdate.Trim() == "PFD").LastUpdate, Is.Unique);
            Assert.That(classifications.First(x => x.LastUpdate.Trim() == "PFD").Description, Is.EqualTo("Preferred Stock"));
        }