Inheritance: Filter
コード例 #1
0
ファイル: PingPongTest.cs プロジェクト: Parks01/Ping-PongNew
        public void CountToNumber_MultiplesOfFifteenPingPong_True()
        {
            List <string> expectedList = new List <string> {
            };

            expectedList.Add("1");
            expectedList.Add("2");
            expectedList.Add("ping");
            expectedList.Add("4");
            expectedList.Add("pong");
            expectedList.Add("ping");
            expectedList.Add("7");
            expectedList.Add("8");
            expectedList.Add("ping");
            expectedList.Add("pong");
            expectedList.Add("11");
            expectedList.Add("ping");
            expectedList.Add("13");
            expectedList.Add("14");
            expectedList.Add("pingpong");

            List <string> actualList = PingPong.CountToNumber(15);

            CollectionAssert.AreEqual(expectedList, actualList);
        }
コード例 #2
0
        public ActionResult DisplayResult()
        {
            PingPong      newPingPong = new PingPong();
            List <string> allNumbers  = newPingPong.GetResult(int.Parse(Request.Form["inputNumber"]));

            return(View(allNumbers));
        }
コード例 #3
0
        public void IsPingPong_NumberDivisibleBy3_True()
        {
            PingPong testPingPong = new PingPong();

            Assert.AreEqual(true, testPingPong.IsPingPong(9));
            Console.WriteLine("Ping-Pong");
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: ousttrue/unity-socket.io
        public Form1()
        {
            InitializeComponent();

            m_socket         = new SocketIOSocket();
            m_socket.Debug   = Console.WriteLine;
            m_socket.Info    = Console.WriteLine;
            m_socket.Warning = Console.WriteLine;
            m_socket.Error   = Console.WriteLine;

            m_socket.On("open", Console.WriteLine);
            m_socket.On("message", Console.WriteLine);
            m_socket.On("close", Console.WriteLine);
            m_socket.On("error", Console.WriteLine);

            m_socket.Start();

            m_ping = new PingPong(m_socket);

            m_timer          = new Timer();
            m_timer.Interval = 33;
            m_timer.Tick    += (o, e) =>
            {
                m_socket.Update();
            };
            m_timer.Start();
        }
コード例 #5
0
        public void GetResult_NumberMultipleOfThree_ping()
        {
            PingPong testPingPong = new PingPong();

            List <string> result = testPingPong.GetResult(3);

            Assert.AreEqual("ping", result[2]);
        }
コード例 #6
0
        public void GetResult_NumberMultipleOfFive_pong()
        {
            PingPong testPingPong = new PingPong();

            List <string> result = testPingPong.GetResult(5);

            Assert.AreEqual("pong", result[4]);
        }
コード例 #7
0
        public void GetResult_NumberMultipleOfFifteen_pingpong()
        {
            PingPong testPingPong = new PingPong();

            List <string> result = testPingPong.GetResult(15);

            Assert.AreEqual("PingPong", result[14]);
        }
コード例 #8
0
        public void GetResult_NumberNotAMultipleOfAbove_2()
        {
            PingPong testPingPong = new PingPong();

            List <string> result = testPingPong.GetResult(2);

            Assert.AreEqual("2", result[1]);
        }
コード例 #9
0
        public ActionResult PingPongResults()
        {
            PingPong      newPingPong  = new PingPong();
            int           userInput    = Int32.Parse(Request.Form["input-number"]);
            List <string> pingPongList = newPingPong.NumberCalc(userInput);

            return(View("PingPongResults", pingPongList));
        }
コード例 #10
0
        public void GetPingPongGame_NumberDivisibleByThreeAndFive_True()
        {
            PingPong testPingPong = new PingPong();

            string[] expectedResult = new string[] { "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "ping-pong" };
            string[] result         = testPingPong.GetPingPongGame(15);
            CollectionAssert.AreEqual(expectedResult, result);
        }
コード例 #11
0
ファイル: UnitTest1.cs プロジェクト: MattSmithereens/PingPong
        public void ThisIsOurTest()
        {
            PingPong      testPingPong = new PingPong();
            List <string> testList     = new List <string>(new string [] { "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "ping pong" });

            //List<int> list = new List<int>(new int[] { 2, 3, 7 });
            CollectionAssert.AreEqual(testList, testPingPong.CreateList(15));
        }
コード例 #12
0
        public void GetNumber_ReturnsNumbers_int()
        {
            PingPong testPingPong = new PingPong(1);
            int      expected     = 1;
            int      test         = testPingPong.GetNumber();

            Assert.AreEqual(expected, test);
        }
コード例 #13
0
        public void IsPingPong_PrintPing_Ping()
        {
            List <string> expected = new List <string> {
                "1", "2", "ping"
            };
            PingPong actual = new PingPong();

            CollectionAssert.AreEqual(expected, actual.IsPingPong(3));
        }
コード例 #14
0
        public void Play_ForNumberFifteen_ListOfOneToFourteenAndPingPong()
        {
            List <string> pingPong     = PingPong.Play(15);
            List <string> expectedList = new List <string> {
                "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "pingpong"
            };

            Assert.Equal(expectedList, pingPong);
        }
コード例 #15
0
        private void CreateAppServiceButton_Click(object sender, RoutedEventArgs e)
        {
            var remoteSystem = SelectedSystem?.RemoteSystem;

            if (remoteSystem != null)
            {
                PingPong.CreateAppService(remoteSystem);
            }
        }
コード例 #16
0
        private static async Task OnEveryQueueTestPerform(PingPong pingPong)
        {
            foreach (var queue in PingPong.GetQueues().Select(o => o[0] as IMpScQueue <IWorkItem>))
            {
                await pingPong.Test_Queue_Performance(queue);

                Console.WriteLine("============================================");
            }
        }
コード例 #17
0
        public void Play_ForNumberTwo_ListOfOneAndTwo()
        {
            List <string> pingPong     = PingPong.Play(2);
            List <string> expectedList = new List <string> {
                "1", "2"
            };

            Assert.Equal(expectedList, pingPong);
        }
コード例 #18
0
ファイル: PingPongTests.cs プロジェクト: ayohana/ping-pong-cs
        public void PrintUserInput_ShowsOutput_StringList()
        {
            PingPong      testGame = new PingPong();
            List <string> testList = new List <string> {
                "1", "2", "\"ping\"", "4", "\"pong\""
            };

            CollectionAssert.AreEqual(testList, testGame.PrintUserInput(5));
        }
コード例 #19
0
        public void PingPongReplace_NumberListTo16()
        {
            PingPong      testPingPong = new PingPong();
            List <string> testList     = new List <string> {
                "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "ping-pong", "16"
            };

            CollectionAssert.AreEqual(testList, testPingPong.PingPongReplace(16));
        }
コード例 #20
0
        public void Translate_DivisibleByThreeAndFiveEquals_PingPong()
        {
            PingPong testBingBong = new PingPong();

            testBingBong.Translate(15);
            List <string> myList = testBingBong.parsedList;

            Assert.AreEqual("ping-pong", myList[myList.Count - 1]);
        }
コード例 #21
0
        public void Translate_NotDivisibleByThreeOrFive_Self()
        {
            PingPong testBingBong = new PingPong();

            testBingBong.Translate(4);
            List <string> myList = testBingBong.parsedList;

            Assert.AreEqual("4", myList[myList.Count - 1]);
        }
コード例 #22
0
        public void IsPingPong_PrintPingPong_PingPong()
        {
            List <string> expected = new List <string> {
                "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "ping-pong"
            };
            PingPong actual = new PingPong();

            CollectionAssert.AreEqual(expected, actual.IsPingPong(15));
        }
コード例 #23
0
        public void PopulateRangeList_IsListPopulated_ListContent()
        {
            PingPong testPingPong = new PingPong();

            CollectionAssert.AreEqual(new List <int>()
            {
                1, 2, 3
            }, testPingPong.PopulateRangeList("3"));
        }
コード例 #24
0
        public void IsPingPong_PrintOne_1()
        {
            List <string> expected = new List <string> {
                "1"
            };
            PingPong actual = new PingPong();

            CollectionAssert.AreEqual(expected, actual.IsPingPong(1));
        }
コード例 #25
0
ファイル: GrpcPingPong.cs プロジェクト: hyiltiz/bond
        private static async Task DoPingPong(PingPong <PingRequest> .PingPongClient client, int requestNum, string payload, UInt16 delay)
        {
            var request = new PingRequest {
                Payload = payload, DelayMilliseconds = delay
            };
            IMessage <PingResponse> response = await client.PingAsync(request);

            Console.WriteLine($"Request #{requestNum} response: \"{response.Payload.Deserialize().Payload}\". Delay: {delay}");
        }
コード例 #26
0
        public void Play_ForNumberFive_ListOfOneTwoPingThreeFourPong()
        {
            List <string> pingPong     = PingPong.Play(5);
            List <string> expectedList = new List <string> {
                "1", "2", "ping", "4", "pong"
            };

            Assert.Equal(expectedList, pingPong);
        }
コード例 #27
0
ファイル: PingPongTests.cs プロジェクト: Connor85/PingPong
        public void isPingPong_untilNumber_True()
        {
            PingPong      testPingPong = new PingPong();
            List <string> testList     = new List <string> {
                "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "ping-pong", "16"
            };

            CollectionAssert.AreEqual(testList, PingPong.isPingPong(16));
        }
コード例 #28
0
        public void TestNumberCalc()
        {
            PingPong      newPingPong           = new PingPong();
            List <string> setValuesPingPongList = new List <string> {
                "1", "2", "Pong", "4", "Ping"
            };

            CollectionAssert.AreEqual(setValuesPingPongList, newPingPong.NumberCalc(5));
        }
コード例 #29
0
    public static void Main()
    {
        PingPong myPingPong = new PingPong();

        Console.WriteLine("Enter a number!");
        int startNumber = int.Parse(Console.ReadLine());

        myPingPong.Translate(startNumber);
    }
コード例 #30
0
        public void Numbers_PingPongNumberLineGenerates_True()
        {
            PingPong      testPingPong       = new PingPong();
            List <string> expectedResultList = new List <string> {
                "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "PiNg-PoNg", "16", "17", "ping", "19", "pong"
            };
            var actualResult = testPingPong.NumberRange(20);

            CollectionAssert.AreEqual(expectedResultList, actualResult);
        }
コード例 #31
0
ファイル: Program.cs プロジェクト: refractalize/refractalize
        private static void RunPingPong()
        {
            var scheduler = new Scheduler();

            var ping = new PingPong("ping");
            var pong = new PingPong("pong");

            ping.Friend = pong;
            pong.Friend = ping;

            scheduler.Spawn(ping, pong);
            scheduler.Schedule();
        }
コード例 #32
0
ファイル: Pong.cs プロジェクト: Mrak-IW/Dot-net-basics
		public void RegisterDelegate(PingPong dlg)
		{
			this.ping = dlg;
		}
コード例 #33
0
ファイル: PingPong.cs プロジェクト: vangan123/rift-sunrise
 public override void OnRead(RiftClient From)
 {
     PingPong Pong = new PingPong();
     Pong.Timestamp = (UInt32)Timestamp;
     From.SendSerialized(Pong);
 }