public void GetAllPaymentsTest() { string authorization = "Basic asdadsa"; mockRestClient.Expects.One.Method(v => v.Execute(new RestRequest())).With(NMock.Is.TypeOf(typeof(RestRequest))).WillReturn(getPaymentResponse); ApiClient apiClient = new ApiClient(mockRestClient.MockObject); apiClient.Configuration = null; Configuration configuration = new Configuration { ApiClient = apiClient, Username = "******", Password = "******", AccessToken = null, ApiKey = null, ApiKeyPrefix = null, TempFolderPath = null, DateTimeFormat = null, Timeout = 60000, UserAgent = "asdasd" }; instance = new PaymentsApi(configuration); var response = instance.GetAllPayments(authorization); Assert.IsInstanceOf <PaymentCollection>(response, "response is PaymentCollection"); }