Example #1
0
        public void GetScripts(
            [Frozen] Mock <IHttpClient> httpClientMock,
            [Greedy] ScriptComponent sut,
            IEnumerable <Script> scripts)
        {
            // ARRANGE
            var json = new JObject(
                new JProperty("listScripts", JArray.FromObject(scripts)));

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

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

            // ASSERT
            result.ShouldBeEquivalentTo(scripts);
            httpClientMock.Verify();
        }