public void GetResources_Success()
        {
            // Act
            var response = controller.GetResources(resourceTypeId, facilityId);

            // Assert
            Assert.IsTrue(response != null, "Response can't be null");
            Assert.IsTrue(response.DataItems != null, "Data items can't be null");
            Assert.IsTrue(response.DataItems.Count > 0, "Atleast one resource must exists.");
        }
Beispiel #2
0
        public void GetResourcesReturnAnInstanceOfIEnumerableResource()
        {
            //Act
            var result = resourceControler.GetResources();

            //Assert
            Assert.IsInstanceOf <IEnumerable <Resource> >(result);
        }
        private async Task SetUp()
        {
            _account = await _userManager.FindByNameAsync(User.Identity.Name);

            _user    = _pulseContext.User.Where(u => u.AccountId == _account.Id).FirstOrDefault();
            _isAdmin = await _userManager.IsInRoleAsync(_account, "Admin");

            _isPeerCoach = await _userManager.IsInRoleAsync(_account, "PeerCoach");

            _isPatient = await _userManager.IsInRoleAsync(_account, "Patient");

            _model.Sender    = _user;
            _model.Resources = _resourcesController.GetResources();
        }