Ejemplo n.º 1
0
        public void GetParameters(
            [Frozen] Mock <IHttpClient> httpClientMock,
            [Greedy] ParamsComponent sut,
            string site,
            IEnumerable <HttpParameter> parameters)
        {
            // ARRANGE
            var json = new JObject(
                new JProperty("Parameters", JArray.FromObject(parameters)));

            httpClientMock.SetupApiCall(sut, CallType.View, "params",
                                        new Parameters
            {
                { "site", site }
            })
            .Returns(json.ToString())
            .Verifiable();

            // ACT
            var result = sut.GetParameters(site);

            // ASSERT
            result.ShouldBeEquivalentTo(parameters);
            httpClientMock.Verify();
        }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
0
        public void ComponentName(
            [Greedy] ParamsComponent sut)
        {
            // ACT
            var result = sut.ComponentName;

            // ASSERT
            result.Should().Be("params");
        }