コード例 #1
0
        public void WhenDataSetSizeLessThanMaxResultIsSuccess()
        {
            // Prepare
            long           maxDatasetSizeInBytes    = 255;
            IConfiguration configuration            = MockFactory.ConfigurationWithMaximumDatasetSizeOf(maxDatasetSizeInBytes);
            MaximumDatasetSizeValidation validation = new MaximumDatasetSizeValidation(configuration);
            INamespaceInfo namespaceInfo            = MockFactory.NamespaceWithPathAndSize("c:\\sample_path", maxDatasetSizeInBytes - 1);

            // Exercise
            IValidationResult validationResult = validation.Validate(namespaceInfo);

            // Verify
            AssertExtension.ValidationResultIsSuccess(validationResult, "Dataset validation triggered an error when dataset is less than max.");
        }
コード例 #2
0
        public void WhenDataSetSizeIsTooBigValidationResultIsError()
        {
            // Prepare
            long           maxDatasetSizeInBytes    = 255;
            IConfiguration configuration            = MockFactory.ConfigurationWithMaximumDatasetSizeOf(maxDatasetSizeInBytes);
            MaximumDatasetSizeValidation validation = new MaximumDatasetSizeValidation(configuration);
            INamespaceInfo namespaceInfo            = MockFactory.NamespaceWithPathAndSize("c:\\sample_path", maxDatasetSizeInBytes + 1);

            // Exercise
            IValidationResult validationResult = validation.Validate(namespaceInfo);

            // Verify
            AssertExtension.ValidationResultIsError(validationResult, "Dataset validation does not trigger an error when dataset is too big.");
        }