Beispiel #1
0
        public static void CreateUser(string username, string pass)
        {
            ClientProcessing cp = new ClientProcessing();
            int id = cp.AddActiveUser();

            cp.CreateUser(String.Format("Username:{0}$$Password:{1}$$UserIV:{0}$$", username, pass), id);
        }
Beispiel #2
0
        public static void StartTests()
        {
            ClientProcessing cp = new ClientProcessing();
            int fId             = cp.AddActiveUser();
            int sId             = cp.AddActiveUser();


            Console.WriteLine(RegisterUser(fId, "test", "haslo1", cp));
            Console.WriteLine(RegisterUser(sId, "test1", "haslo2", cp));

            Console.WriteLine(Login(fId, "test", "haslo1", cp));
            Console.WriteLine(Login(sId, "test1", "haslo2", cp));

            Console.WriteLine(CheckUsername(fId, "test1", cp));
            Console.WriteLine(CheckUsername(fId, "test2", cp));

            InvitationProcces(cp, fId, sId);
            //Console.WriteLine(DeclineFriend(fId, 1, cp));
        }
Beispiel #3
0
        public static void FriendsAddTest()
        {
            ClientProcessing cp = new ClientProcessing();
            int id  = cp.AddActiveUser();
            int id1 = cp.AddActiveUser();

            Console.WriteLine(cp.Login("Username:test1$$Password:test1234$$", id));
            Console.WriteLine(cp.Login("Username:test2$$Password:test1234$$", id1));

            string pk  = BigInteger.Parse("1572974685565517564760848834612061204603051782958757453266089894").ToString("X");
            string pri = BigInteger.Parse("2171516053468561523083790486470955343976023523132159054917711086").ToString("X");
            string iv  = BigInteger.Parse("48040271114089576525052332491161").ToString("X");

            Console.WriteLine(cp.AddFriend("SecondUserName:test2$$", id));
            Console.WriteLine(cp.DhExchange(String.Format("InvitationID:1$$PK:{0}$$PrivateK:{1}$$IV:{2}$$", pk, pri, iv), id));
            Console.WriteLine(cp.SendInvitations("", id1));
            Console.WriteLine(cp.AcceptFriend("InvitationID:1$$PKB:4$$", id1));
            Console.WriteLine(cp.SendConversationKey("ConversationID:1$$ConversationKey:ytyt$$", id1));


            Console.WriteLine(cp.SendAcceptedFriends("", id));
            Console.WriteLine(cp.SendConversationKey("ConversationID:1$$ConversationKey:ytyoit$$", id));
        }
Beispiel #4
0
        public static void MessageTest()
        {
            ClientProcessing cp = new ClientProcessing();
            int id  = cp.AddActiveUser();
            int id1 = cp.AddActiveUser();

            cp.Login("Username:test8$$Password:test1234$$", id);
            cp.Login("Username:test7$$Password:12345678$$", id1);


            Console.WriteLine(cp.ActivateConversation("ConversationID:6$$", id));
            Console.WriteLine(cp.NewMessages("", id));
            Message m = new Message {
                date = DateTime.Now, message = "test", username = "******"
            };
            string s = JsonConvert.SerializeObject(m);

            Console.WriteLine(cp.SendMessage(String.Format("Username:test7$$Data:{0}$$", s), id));
            Console.WriteLine(cp.SendMessage(String.Format("Username:test7$$Data:{0}$$", s), id));
            Console.WriteLine(cp.Notification("", id1));
            Console.WriteLine(cp.Notification("", id1));
            Console.WriteLine(cp.ActivateConversation("ConversationID:6$$", id1));
            Console.WriteLine(cp.NewMessages("", id1));
        }