예제 #1
0
        public GenericSystemsControllerTests()
        {
            var systemModel = new GenericSystemViewModel
            {
                Id          = "5a8417338317338c8e0809e5",
                Name        = "Ambulance Service Call Handler",
                FModule     = "Ambulance_Service_Call_Handler",
                Asid        = "200000000115",
                Context     = "Some context...",
                ActionTypes = new List <ActorType> {
                    ActorType.Consumer
                }
            };

            var personelModel = new PersonnelViewModel
            {
                Id       = "5a8417f68317338c8e080a62",
                Name     = "999 Call Handler",
                ImageUrl = "....",
                Context  = new List <ContentView>()
                {
                    new ContentView
                    {
                        Title   = "Title Text",
                        Content = new List <string> {
                            "Content Text"
                        },
                        CssClass = "CssClass Text",
                        Order    = 1
                    }
                },
                UsesNrls            = true,
                ActorOrganisationId = "5a82f9ffcb969daa58d33377",
                CModule             = "CModule-Type",
                SystemIds           = new List <string> {
                    "5a8417338317338c8e0809e5"
                },
                Benefits = new List <string> {
                    "benefitid"
                }
            };

            var genericSystemService = new Mock <IGenericSystemService>();

            genericSystemService.Setup(x => x.GetById(It.Is <string>(y => y == "5a8417338317338c8e0809e5"))).Returns(Task.Run(() => systemModel));
            genericSystemService.Setup(x => x.GetById(It.Is <string>(y => y == "5a8417338317338c8e0809e6"))).Returns(Task.Run(() => (GenericSystemViewModel)null));

            var personnelService = new Mock <IPersonnelService>();

            personnelService.Setup(x => x.GetModelBySystemId(It.Is <string>(y => y == "5a8417f68317338c8e080a62"))).Returns(Task.Run(() => personelModel));
            personnelService.Setup(x => x.GetModelBySystemId(It.Is <string>(y => y == "5a8417f68317338c8e080a63"))).Returns(Task.Run(() => (PersonnelViewModel)null));

            _genericSystemService = genericSystemService.Object;
            _personnelService     = personnelService.Object;
        }
예제 #2
0
 public void Dispose()
 {
     _genericSystemService = null;
     _personnelService     = null;
 }
예제 #3
0
 public GenericSystemsController(IGenericSystemService genericSystemService)
 {
     _genericSystemService = genericSystemService;
 }
 public GenericSystemsController(IGenericSystemService genericSystemService, IPersonnelService personnelService)
 {
     _genericSystemService = genericSystemService;
     _personnelService     = personnelService;
 }