public async Task ShouldUpdateAsyncFromModelRequestHaveCorrectMeshNameFromAttributeAndUrl()
        {
            var requestService = new Mock <IRequestService>();

            var passedUrl   = string.Empty;
            var passedModel = default(MeshNameAttributeClassTest);

            var expectedModel = new MeshNameAttributeClassTest();

            requestService.Setup(x => x.PutRequest <MeshNameAttributeClassTest>(It.IsAny <string>(), It.IsAny <object>())).Callback((string url, object model) =>
            {
                passedUrl   = url;
                passedModel = model as MeshNameAttributeClassTest;
            }).Returns(() =>
            {
                return(Task.FromResult(It.IsAny <MeshNameAttributeClassTest>()));
            }).Verifiable();

            var service = new MeshesService(requestService.Object);
            var id      = Generator.RandomString(25);

            expectedModel.Id = id;

            await service.UpdateAsync(expectedModel).ConfigureAwait(false);

            Assert.Equal($"meshes/{MeshName.ToLowerInvariant()}/{id}", passedUrl);
            Assert.Equal(expectedModel, passedModel);

            requestService.VerifyAll();
        }
        public async Task ShouldCreateAsyncRequestHaveCorrectMeshNameFromAttributeAndUrl()
        {
            var requestService = new Mock <IRequestService>();

            var passedUrl    = string.Empty;
            var passedModel  = default(MeshNameAttributeClassTest);
            var passedFormat = default(RequestDataFormat);

            var expectedModel = new MeshNameAttributeClassTest();

            requestService.Setup(x => x.PostRequest <MeshNameAttributeClassTest>(It.IsAny <string>(), It.IsAny <object>(), It.IsAny <RequestDataFormat>())).Callback((string url, object model, RequestDataFormat format) =>
            {
                passedUrl    = url;
                passedModel  = model as MeshNameAttributeClassTest;
                passedFormat = format;
            }).Returns(() =>
            {
                return(Task.FromResult(It.IsAny <MeshNameAttributeClassTest>()));
            }).Verifiable();

            var service = new MeshesService(requestService.Object);
            await service.CreateAsync(expectedModel).ConfigureAwait(false);

            Assert.Equal($"meshes/{MeshName.ToLowerInvariant()}", passedUrl);
            Assert.Equal(expectedModel, passedModel);
            Assert.Equal(RequestDataFormat.Json, passedFormat);

            requestService.VerifyAll();
        }