public void TestPhoneIdScoreWrapsParserErrors()
        {
            string message = "My exception message";
            IPhoneIdResponseParser parser = new FakeResponseParser()
            {
                ExpectedException = new Exception(message),
            };

            PhoneIdService service = this.CreateService(null, parser);

            Assert.Throws <ResponseParseException>(delegate
            {
                service.ScoreLookup("15555555555");
            });
        }
        private PhoneIdService CreateService(
            IWebRequester webRequester            = null,
            IPhoneIdResponseParser responseParser = null)
        {
            if (webRequester == null)
            {
                webRequester = new FakeWebRequester();
            }

            if (responseParser == null)
            {
                responseParser = new FakeResponseParser();
            }

            return(new PhoneIdService(
                       this.GetConfiguration(),
                       webRequester,
                       responseParser));
        }
        private PhoneIdService CreateService(
                    IWebRequester webRequester = null, 
                    IPhoneIdResponseParser responseParser = null)
        {
            if (webRequester == null)
            {
                webRequester = new FakeWebRequester();
            }

            if (responseParser == null)
            {
                responseParser = new FakeResponseParser();
            }

            return new PhoneIdService(
                        this.GetConfiguration(), 
                        webRequester, 
                        responseParser);
        }
        public void TestPhoneIdScoreWrapsParserErrors()
        {
            string message = "My exception message";
            IPhoneIdResponseParser parser = new FakeResponseParser()
            {
                ExpectedException = new Exception(message),
            };

            PhoneIdService service = this.CreateService(null, parser);

            Assert.Throws<ResponseParseException>(delegate
            {
                service.ScoreLookup("15555555555");
            });
        }