public void ShouldNotThrowArgumentOutOfRangeExceptionWhenClusterConfigurationIsValid() { // Given CouchbaseTestcontainerConfiguration configuration = null; Action action = () => configuration = new CouchbaseTestcontainerConfiguration { BucketName = "Bucket", BucketType = "MEMCACHED", BucketRamSize = "1024", ClusterRamSize = "256", ClusterIndexRamSize = "256", ClusterFtsRamSize = "256", ClusterEventingRamSize = "256", ClusterAnalyticsRamSize = "1024", }; // When var exception = Record.Exception(action.Invoke); // Then Assert.Null(exception); Assert.Equal("Bucket", configuration.BucketName); Assert.Equal("MEMCACHED", configuration.BucketType); Assert.Equal("1024", configuration.BucketRamSize); Assert.Equal("256", configuration.ClusterRamSize); Assert.Equal("256", configuration.ClusterIndexRamSize); Assert.Equal("256", configuration.ClusterFtsRamSize); Assert.Equal("256", configuration.ClusterEventingRamSize); Assert.Equal("1024", configuration.ClusterAnalyticsRamSize); }
public void ShouldThrowArgumentOutOfRangeExceptionWhenClusterAnalyticsRamSizeIsNotValid() { // Given Action action = () => _ = new CouchbaseTestcontainerConfiguration { ClusterAnalyticsRamSize = "1023" }; // When var exception = Assert.Throws <ArgumentOutOfRangeException>(action.Invoke); // Then Assert.Equal("Couchbase ClusterAnalyticsRamSize ram size can not be less than 1024 MB. (Parameter 'ClusterAnalyticsRamSize')", exception.Message); }
public void ShouldThrowArgumentExceptionWhenRamSizeIsNotAnInteger() { // Given Action action = () => _ = new CouchbaseTestcontainerConfiguration { ClusterRamSize = nameof(double.NaN) }; // When var exception = Assert.Throws <ArgumentException>(action.Invoke); // Then Assert.Equal("NaN is not an integer. (Parameter 'ClusterRamSize')", exception.Message); }