Пример #1
0
        public void Directory_GeMetadata()
        {
            using var provider = Application.CreateProvider(o =>
            {
                o.BaseAddress = Application.BaseAddress;
                o.ExternalAccountOptions.Type = ExternalAccountType.Required;
            });
            IAcmeController controller = (IAcmeController)provider.GetService(typeof(IAcmeController));

            var response = controller.GetDirectory(new AcmeRequest
            {
                Path   = $"{Application.BaseAddress}directory",
                Method = "GET",
            });

            var content = response.GetContent <Protocol.Directory>();

            Assert.NotNull(content.Meta);
            Assert.Equal(true, content.Meta.ExternalAccountRequired);
        }
Пример #2
0
        public void Directory_Get()
        {
            using var provider = Application.CreateProvider();
            IAcmeController controller = (IAcmeController)provider.GetService(typeof(IAcmeController));

            var response = controller.GetDirectory(new AcmeRequest
            {
                Path   = $"{Application.BaseAddress}directory",
                Method = "GET",
            });

            var content = response.GetContent <Protocol.Directory>();

            Assert.Equal($"{Application.BaseAddress}new-nonce", content.NewNonce);
            Assert.Equal($"{Application.BaseAddress}new-acct", content.NewAccount);
            Assert.Equal($"{Application.BaseAddress}new-order", content.NewOrder);
            // TODO Assert.Equal($"{Application.BaseAddress}new-authz", content.NewAuthz);
            Assert.Equal($"{Application.BaseAddress}revoke", content.RevokeCertificate);
            Assert.Equal($"{Application.BaseAddress}key-change", content.KeyChange);
            Assert.Null(content.Meta);
        }