public void PutServiceCollection_ServiceCollectionIdNotValid(string serviceCollectionId)
        {
            // Arrange
            var controller = new V7ServiceCollectionController(serviceCollectionServiceMockSetup.Object,
                                                               commonService, serviceService, userService, settings, logger);

            // Act
            var result = controller.Put(serviceCollectionId, new V7VmOpenApiServiceCollectionInBase());

            // Assert
            var notFoundResult = Assert.IsType <NotFoundObjectResult>(result);

            Assert.IsType <VmError>(notFoundResult.Value);
        }
        public void PutServiceCollection_RequestIsNull()
        {
            // Arrange
            var controller = new V7ServiceCollectionController(serviceCollectionServiceMockSetup.Object,
                                                               commonService, serviceService, userService, settings, logger);

            // Act
            var result = controller.Put(strId, null);

            // Assert
            var badResult = Assert.IsType <BadRequestObjectResult>(result);

            Assert.IsType <SerializableError>(badResult.Value);
        }
        public void PutServiceCollection_ServiceCollectionNotExists()
        {
            // Arrange
            serviceCollectionServiceMockSetup.Setup(s => s.ServiceCollectionExists(id)).Returns(false);
            var controller = new V7ServiceCollectionController(serviceCollectionServiceMockSetup.Object,
                                                               commonService, serviceService, userService, settings, logger);

            // Act
            var result = controller.Put(strId, new V7VmOpenApiServiceCollectionInBase());

            // Assert
            var notFoundResult = Assert.IsType <NotFoundObjectResult>(result);

            Assert.IsType <VmError>(notFoundResult.Value);
        }
        public void PutServiceCollection_CanModifyServiceCollection()
        {
            // Arrange
            serviceCollectionServiceMockSetup.Setup(s => s.ServiceCollectionExists(id)).Returns(true);
            serviceCollectionServiceMockSetup.Setup(s => s.GetServiceCollectionById(id, 0, false))
            .Returns(new V7VmOpenApiServiceCollection()
            {
                PublishingStatus = PublishingStatus.Published.ToString()
            });
            serviceCollectionServiceMockSetup.Setup(s => s.SaveServiceCollection(It.IsAny <VmOpenApiServiceCollectionInVersionBase>(), It.IsAny <bool>(), defaultVersion, null, null))
            .Returns(new V7VmOpenApiServiceCollection());
            var controller = new V7ServiceCollectionController(serviceCollectionServiceMockSetup.Object,
                                                               commonService, serviceService, userService, settings, logger);

            // Act
            var result = controller.Put(strId, new V7VmOpenApiServiceCollectionInBase());

            // Assert
            var okResult = Assert.IsType <OkObjectResult>(result);

            Assert.IsType <V7VmOpenApiServiceCollection>(okResult.Value);
        }