private void MockAuthorizationForStartechsWhichUserIsLeader()
 {
     StartechAuthorizationService.Setup(x => x.IsMemberOrLeaderOf(Startechs.Agile, true)).Returns(Task.Factory.StartNew(() => true));
     foreach (Startechs startech in Enum.GetValues(typeof(Startechs)).Cast <Startechs>().Where(x => x != Startechs.Agile))
     {
         StartechAuthorizationService.Setup(x => x.IsMemberOrLeaderOf(startech, true)).Returns(Task.Factory.StartNew(() => false));
     }
 }
Example #2
0
        private void Authorize(StarpointsItem starpointsItem, bool isLeader = false)
        {
            var isLeaderValue = isLeader;
            var itemsStartech = starpointsItem.Startech;

            StartechAuthorizationService.Setup(x => x.IsMemberOrLeaderOf(It.IsIn(itemsStartech), It.IsIn(true)))
            .Returns(Task.Factory.StartNew(() => isLeader));
        }
 private void MockAuthorizationForAvailableStartechs()
 {
     StartechAuthorizationService.Setup(x => x.IsMemberOrLeaderOf(Startechs.Java, false)).Returns(Task.Factory.StartNew(() => true));
     foreach (Startechs startech in Enum.GetValues(typeof(Startechs)).Cast <Startechs>().Where(x => x != Startechs.Java))
     {
         StartechAuthorizationService.Setup(x => x.IsMemberOrLeaderOf(startech, false)).Returns(Task.Factory.StartNew(() => false));
     }
 }