예제 #1
0
        public void CallDialTest()
        {
            //client
            var httpClient = new Mock <IHttpClient>(MockBehavior.Strict);

            httpClient.Setup(x => x.Post(It.IsAny <Uri>(), It.IsAny <string>())).Returns(Encoding.UTF8.GetString(Properties.Resources.CallDial));

            //service
            var phoneCall = new PhoneCallService(httpClient.Object);
            //api
            var api = new HIPApi(phoneCall: phoneCall);
            //do the job
            var response = api.PhoneCall.CallDial("123456789");

            if (response.Success)
            {
                var resp = (CallDialResponse)response;
                Assert.True(resp.Session == 2);
            }
            else
            {
                var resp = (ErrorResponse)response;
                _output.WriteLine(resp.Description);
                Assert.True(false);
            }
        }
예제 #2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            if (!string.IsNullOrWhiteSpace(AppSettings.HockeyAppiOS))
            {
                var manager = BITHockeyManager.SharedHockeyManager;
                manager.Configure(AppSettings.HockeyAppiOS);

                // Disable update manager
                manager.DisableUpdateManager = true;
                manager.StartManager();
            }

            global::Xamarin.Forms.Forms.Init();

            RegisterPlatformDependencies();
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            CachedImageRenderer.Init();
            PhoneCallService.Init();
            var ignore = new CircleTransformation();

            Xamarin.FormsMaps.Init();

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
예제 #3
0
        public void PhoneStatusTest()
        {
            //client
            var httpClient = new Mock <IHttpClient>(MockBehavior.Strict);

            httpClient.Setup(x => x.Get(It.IsAny <Uri>())).Returns(Encoding.UTF8.GetString(Properties.Resources.PhoneStatus));

            //service
            var phoneCall = new PhoneCallService(httpClient.Object);
            //api
            var api = new HIPApi(phoneCall: phoneCall);
            //do the job
            var response = api.PhoneCall.PhoneStatus();

            if (response.Success)
            {
                var resp = (PhoneStatusResponse)response;
                Assert.True(resp.Accounts.OfType <AccountEntity>().Any());
            }
            else
            {
                var resp = (ErrorResponse)response;
                _output.WriteLine(resp.Description);
                Assert.True(false);
            }
        }
예제 #4
0
        public void CallStatusTest()
        {
            //client
            var httpClient = new Mock <IHttpClient>(MockBehavior.Strict);

            httpClient.Setup(x => x.Get(It.IsAny <Uri>())).Returns(Encoding.UTF8.GetString(Properties.Resources.CallStatus));

            //service
            var phoneCall = new PhoneCallService(httpClient.Object);
            //api
            var api = new HIPApi(phoneCall: phoneCall);
            //do the job
            var response = api.PhoneCall.CallStatus();

            if (response.Success)
            {
                var resp = (CallStatusResponse)response;
                Assert.True(resp.Sessions.OfType <SessionEntity>().Any());
                var session = resp.Sessions.First();
                Assert.True(session.Id == 1);
                Assert.True(session.Direction == SessionDirection.Outgoing);
                Assert.True(session.State == SessionState.Ringing);
            }
            else
            {
                var resp = (ErrorResponse)response;
                _output.WriteLine(resp.Description);
                Assert.True(false);
            }
        }
예제 #5
0
        // GET: PhoneCall
        // Phone call action method
        public ActionResult CallMember(int?id, string number)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var    member         = unitOfWork.MemberRepository.FindMemberById(id);
            string memberFullName = $"{member.FirstName} {member.LastName}";

            var phoneCallContact = new PhoneCallContact
            {
                MemberId            = (int)id,
                MemberFullName      = memberFullName,
                CallDateTime        = DateTime.Now,
                PhoneNumber         = number,
                HrefPhoneNumberLink = PhoneCallService.GetHrefPhoneNumberLink(number)
            };

            var contactTypes = unitOfWork.ContactTypeRepository.FindAll(ct => ct.Name.Contains("Call"));

            phoneCallContact.ContactTypes = new SelectList(contactTypes, "Id", "Name");

            return(View(phoneCallContact));
        }
 public CcgMembersController()
 {
     _service          = new CcgMembersService(base.unitOfWork);
     _photoService     = new MemberPhotoService(base.unitOfWork);
     _phoneCallService = new PhoneCallService(base.unitOfWork);
     _ccgService       = new CCGService(base.unitOfWork);
 }
        // GET: CcgMembers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var ccgMember = unitOfWork.MemberRepository.FindMemberById(id);

            if (ccgMember == null)
            {
                return(HttpNotFound());
            }

            var memberDetailsVM = Mapper.Map <DetailsMemberViewModel>(ccgMember);

            _service.SetImgSrcAndHasPhotoFlag(memberDetailsVM);

            var ccg = unitOfWork.CCGRepository.FindById(memberDetailsVM.CCG.Id);

            //concat ccg name with deacon last names
            memberDetailsVM.CCG.CCGName = _ccgService.SetCCGViewName(ccg);


            // If user is not the member's deacon, use href links for phone numbers
            // Users who are not the member's deacon cannot make calls through the app
            memberDetailsVM.IsUserMemberDeacon = AuthHelper.IsMemberDeacon(User.Identity.Name, ccgMember.Id);
            if (!memberDetailsVM.IsUserMemberDeacon)
            {
                memberDetailsVM.HrefPhoneNumberLink
                    = PhoneCallService.GetHrefPhoneNumberLink(ccgMember.PhoneNumber);
                memberDetailsVM.HrefCellNumberLink
                    = PhoneCallService.GetHrefPhoneNumberLink(ccgMember.CellPhoneNumber);
            }
            return(View(memberDetailsVM));
        }
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            SupportActionBar.SetDisplayShowHomeEnabled(true);   // Show or hide the default home button
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowCustomEnabled(true); // Enable overriding the default toolbar layout
            SupportActionBar.SetDisplayShowTitleEnabled(false);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            UserDialogs.Init(this);
            CachedImageRenderer.Init();
            PhoneCallService.Init();
            Xamarin.FormsMaps.Init(this, bundle);

            InitializeHockeyApp();

            LoadApplication(new App());
        }
예제 #9
0
 public PhoneCallWorkflow(PhoneCallService phoneCallService)
 {
     _phoneCallService = phoneCallService;
 }
예제 #10
0
 public PhoneCallController()
 {
     _service = new PhoneCallService(base.unitOfWork);
 }