示例#1
0
 public ZapClient(string host, int port, Protocols protocol = Protocols.http)
 {
     Protocol          = protocol;
     Host              = host;
     Port              = port;
     Acsrf             = new AcsrfComponent(this);
     AjaxSpider        = new AjaxSpiderComponent(this);
     Ascan             = new AscanComponent(this);
     Authentication    = new AuthenticationComponent(this);
     Authorization     = new AuthorizationComponent(this);
     Autoupdate        = new AutoupdateComponent(this);
     Break             = new BreakComponent(this);
     Context           = new ContextComponent(this);
     Core              = new CoreComponent(this);
     ForcedUser        = new ForcedUserComponent(this);
     HttpSessions      = new HttpSessionsComponent(this);
     Params            = new ParamsComponent(this);
     Pscan             = new PscanComponent(this);
     Reveal            = new RevealComponent(this);
     Script            = new ScriptComponent(this);
     Search            = new SearchComponent(this);
     Selenium          = new SeleniumComponent(this);
     SessionManagement = new SessionManagementComponent(this);
     Spider            = new SpiderComponent(this);
     Users             = new UsersComponent(this);
 }
示例#2
0
        public void ComponentName(
            [Greedy] RevealComponent sut)
        {
            // ACT
            var result = sut.ComponentName;

            // ASSERT
            result.Should().Be("reveal");
        }
示例#3
0
        public void SetRevealEnabled(
            [Frozen] Mock <IHttpClient> httpClientMock,
            [Greedy] RevealComponent sut,
            bool enabled)
        {
            // ARRANGE
            httpClientMock.SetupApiCall(sut, CallType.Action, "setReveal",
                                        new Parameters
            {
                { "reveal", enabled }
            })
            .ReturnsOkResult()
            .Verifiable();

            // ACT
            sut.SetRevealEnabled(enabled);

            // ASSERT
            httpClientMock.Verify();
        }
示例#4
0
        public void IsRevealEnabled(
            [Frozen] Mock <IHttpClient> httpClientMock,
            [Greedy] RevealComponent sut,
            bool isEnabled)
        {
            // ARRANGE
            var json = new JObject(
                new JProperty("reveal", isEnabled));

            httpClientMock.SetupApiCall(sut, CallType.View, "reveal")
            .Returns(json.ToString())
            .Verifiable();

            // ACT
            var result = sut.IsRevealEnabled();

            // ASSERT
            result.Should().Be(isEnabled);
            httpClientMock.Verify();
        }