Ejemplo n.º 1
0
        public void GenerateRandomString()
        {
            var randomString1 = RandomUtil.GenerateRandomString(10);
            var randomString2 = RandomUtil.GenerateRandomString(10);

            Assert.That(randomString1.Length, Is.EqualTo(10));
            Assert.That(randomString2.Length, Is.EqualTo(10));
            Assert.That(randomString1, Is.Not.EqualTo(randomString2));
        }
Ejemplo n.º 2
0
        private void GenerateNewPassword()
        {
            var options = GetGeneratorOptions();

            if (options == 0)
            {
                return;
            }

            txtGeneratedString.Text = RandomUtil.GenerateRandomString((int)txtLength.Value, options);
        }
Ejemplo n.º 3
0
    public override void OnJoinRandomFailed(short returnCode, string message)
    {
        NetworkDebugCanvas.SetConnectionStatus("Failed To Join Room");

        NetworkDebugCanvas.SetConnectingStatus("Creating New Room");

        RoomOptions roomOptions = new RoomOptions();

        roomOptions.IsVisible  = true;
        roomOptions.MaxPlayers = 2;
        PhotonNetwork.JoinOrCreateRoom(RandomUtil.GenerateRandomString(20), roomOptions, TypedLobby.Default);
    }
Ejemplo n.º 4
0
        public void GenerateRandomStringWithOptions()
        {
            var randomStringOptions =
                RandomUtil.StringGeneratorOptions.Digits |
                RandomUtil.StringGeneratorOptions.LowerCase |
                RandomUtil.StringGeneratorOptions.UpperCase |
                RandomUtil.StringGeneratorOptions.Special;

            var randomString1 = RandomUtil.GenerateRandomString(11, randomStringOptions);
            var randomString2 = RandomUtil.GenerateRandomString(11, randomStringOptions);

            Assert.That(randomString1.Length, Is.EqualTo(11));
            Assert.That(randomString2.Length, Is.EqualTo(11));
            Assert.That(randomString1, Is.Not.EqualTo(randomString2));
        }