public static ShGuidSettings CreateDefaultIfNull(ShGuidSettings settings)
        {
            if (settings == null)
            {
                return(new ShGuidSettings());
            }

            return(settings);
        }
Exemplo n.º 2
0
        public void ShGuid_DefaultSettingsConstructor_CheckTrim()
        {
            // Arrange
            var expectedGuid      = Guid.Empty;
            var expectedShortGuid = "AAAAAAAAAAAAAAAAAAAAAA==";
            var expectedLength    = 24;

            var settings = new ShGuidSettings('_', '-', false);
            // Act
            var shGuid = new ShGuid(settings);

            // Assert
            Assert.AreEqual <Guid>(expectedGuid, shGuid.Guid);
            Assert.AreEqual(expectedShortGuid, shGuid.ShortGuid);
            Assert.AreEqual(expectedLength, shGuid.ShortGuid.Length);
        }