Пример #1
0
            public void ShouldReturnExpected_WhenUsingSingleLong(long input, string namespaceIn, string namespaceOut, long?expected)
            {
                // Arrange
                var guid = Gluid.NewGluid(input, namespaceIn);

                // Act
                var result = guid.ToInt64(namespaceOut);

                // Assert
                result.Should().Be(expected);
            }
Пример #2
0
            public void ShouldReturnTrue_WhenGuidIsAGluid()
            {
                // Arrange
                var guid = Gluid.NewGluid(1, "test");

                // Act
                var result = guid.IsGluid();

                // Assert
                result.Should().BeTrue();
            }
Пример #3
0
            public void ShouldReturnExpected_WhenCuidIsAGluidAndNamespaceIsPassed(string namespaceIn, string namespaceOut, bool expected)
            {
                // Arrange
                var number = (new Random()).Next();
                var guid   = Gluid.NewGluid(number, namespaceIn);

                // Act
                var result = guid.IsLinked(namespaceOut);

                // Assert
                result.Should().Be(expected);
            }
Пример #4
0
            public void ShouldReturnExpected_WhenUsingTwoInts(int input1, int input2, string namespaceIn, string namespaceOut, int?expected1, int?expected2)
            {
                // Arrange
                var guid = Gluid.NewGluid(input1, input2, namespaceIn);

                // Act
                var result1 = guid.ToInt32(namespaceOut);
                var result2 = guid.GetSecondInt32(namespaceOut);

                // Assert
                result1.Should().Be(expected1);
                result2.Should().Be(expected2);
            }