Exemplo n.º 1
0
        public void GenerateInt64_ShouldBeSuccessful(int length)
        {
            var randNumber = Uniquify.GetInt64(length);

            randNumber.ToString().Should().HaveLength(length);
            randNumber.Should().BeOfType(typeof(long)).And.NotBe(0);
        }
Exemplo n.º 2
0
        public void GenerateString_WithSingleChar_ShouldBeSuccessful()
        {
            var uniqueString = Uniquify.GetString("q", 12);

            uniqueString.Should().NotBeEmpty().And.HaveLength(12).And.Be("qqqqqqqqqqqq");
        }
Exemplo n.º 3
0
        public void GenerateCustomAlphabetString_ShouldBeSuccessful(int length, string chars)
        {
            var uniqueString = Uniquify.GetString(chars, length);

            uniqueString.Should().NotBeEmpty().And.HaveLength(length).And.ContainAny(chars.Select(c => c.ToString()).ToArray());
        }
Exemplo n.º 4
0
        public void GenerateString_ShouldBeSuccessful(int length)
        {
            var uniqueString = Uniquify.GetString(length);

            uniqueString.Should().NotBeEmpty().And.HaveLength(length);
        }
Exemplo n.º 5
0
        public void GenerateInt64_WithOutOfRangeLength_ShouldBeFailed(int length)
        {
            Action waitingForException = () => Uniquify.GetInt64(length);

            waitingForException.Should().Throw <ArgumentOutOfRangeException>();
        }