Ejemplo n.º 1
0
        public async Task DemonstratePassthrough()
        {
            var request = new EmailPasswordRequest
            {
                Email    = "*****@*****.**",
                Password = "******"
            };
            var client = new ReqResClient(CreateHttpClient(mode: HttpRecorderMode.Passthrough));

            var result = await client.Register(request);

            result.Token.Should().NotBeNullOrEmpty();
        }
Ejemplo n.º 2
0
        public async Task DemonstrateStandardConfiguration()
        {
            var request = new EmailPasswordRequest
            {
                Email    = "*****@*****.**",
                Password = "******"
            };
            var client = new ReqResClient(CreateHttpClient());

            var result = await client.Register(request);

            result.Token.Should().NotBeNullOrEmpty();
        }
Ejemplo n.º 3
0
        public async Task DemonstrateCustomMatching()
        {
            var request = new EmailPasswordRequest
            {
                Email    = "*****@*****.**",
                Password = "******"
            };
            var client = new ReqResClient(
                CreateHttpClient(
                    mode: HttpRecorderMode.Replay,
                    matcher: RulesMatcher.MatchMultiple.ByRequestUri(UriPartial.Authority)));

            // First time
            var result = await client.Register(request);

            result.Token.Should().NotBeNullOrEmpty();

            // Second time - this works because of the MatchMultiple configuration.
            result = await client.Register(request);

            result.Token.Should().NotBeNullOrEmpty();
        }