public void TwoStringTest1()
        {
            //Apply
            string[] expectedSuccessfulTest = { "YES", "NO" };
            string[] successfulTestStr1     = { "hello", "hi" };
            string[] successfulTestStr2     = { "world", "world" };
            var      x = 0;

            //Act
            string[] successfulResults = new string[successfulTestStr1.Length];
            var      twoStrings        = new TwoStrings();

            for (x = 0; x < successfulTestStr1.Length; x++)
            {
                successfulResults[x] = twoStrings.TwoString(successfulTestStr1[x], successfulTestStr2[x]);
            }
            //Assert
            bool successTest = true;

            for (x = 0; x < successfulTestStr1.Length; x++)
            {
                if (expectedSuccessfulTest[x] != successfulResults[x])
                {
                    successTest = false;
                }
            }
            Assert.IsTrue(successTest);
        }
        public void TwoStringTest2()
        {
            //Apply
            string[] expectedSuccessfulTest = { "NO", "YES", "YES", "NO" };
            string[] successfulTestStr1     = { "wouldyoulikefries", "hackerrankcommunity", "jackandjill", "writetoyourparents" };
            string[] successfulTestStr2     = { "abcabcabcabcabcabc", "cdecdecdecde", "wentupthehill", "fghmqzldbc" };
            var      x = 0;

            //Act
            string[] successfulResults = new string[successfulTestStr1.Length];
            var      twoStrings        = new TwoStrings();

            for (x = 0; x < successfulTestStr1.Length; x++)
            {
                successfulResults[x] = twoStrings.TwoString(successfulTestStr1[x], successfulTestStr2[x]);
            }
            //Assert
            bool successTest = true;

            for (x = 0; x < successfulTestStr1.Length; x++)
            {
                if (expectedSuccessfulTest[x] != successfulResults[x])
                {
                    successTest = false;
                }
            }
            Assert.IsTrue(successTest);
        }
        public void TwoStringTest3()
        {
            //Apply
            string[] expectedSuccessfulTest = { "YES", "NO" };
            string[] successfulTestStr1     = { "aardvark", "beetroot" };
            string[] successfulTestStr2     = { "apple", "sandals" };
            var      x = 0;

            //Act
            string[] successfulResults = new string[successfulTestStr1.Length];
            var      twoStrings        = new TwoStrings();

            for (x = 0; x < successfulTestStr1.Length; x++)
            {
                successfulResults[x] = twoStrings.TwoString(successfulTestStr1[x], successfulTestStr2[x]);
            }
            //Assert
            bool successTest = true;

            for (x = 0; x < successfulTestStr1.Length; x++)
            {
                if (expectedSuccessfulTest[x] != successfulResults[x])
                {
                    successTest = false;
                }
            }
            Assert.IsTrue(successTest);
        }
        public void TestBasicImplementationDictionary()
        {
            string expectedResult = "NO";
            string S1             = "abhiabhiabhiabhiabhiabhi";
            string S2             = "hibbhibbhibbhibbhibbhibb";
            string actualResult   = "";

            actualResult = TwoStrings.BasicImplementationDictionary(S1, S2);
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemplo n.º 5
0
        public void LoadSharedResources()
        {
            string input = "R[\n  0: String \"Foo\"\n]\nLoadTest+TwoStrings {\n  A: #0,\n  B: #0\n}";
            Dom    dom   = Dom.Load(input);

            TwoStrings output = dom.Deserialise <TwoStrings>();

            Assert.IsNotNull(output);
            Assert.AreEqual("Foo", output.A);
            Assert.AreEqual("Foo", output.B);
            Assert.ReferenceEquals(output.A, output.B);
        }
Exemplo n.º 6
0
        public void SaveSharedResources()
        {
            string     foo   = "Foo";
            TwoStrings value = new TwoStrings()
            {
                A = foo, B = foo
            };

            Dom dom = Dom.Serialise(value);

            string output   = dom.Save();
            string expected = "R[\n  0: String \"Foo\"\n]\nSaveTest+TwoStrings {\n  A: #0,\n  B: #0\n}";

            Assert.AreEqual(expected, output);
        }
Exemplo n.º 7
0
        public void ThreeLinesTest()
        {
            var lines = new List <string>()
            {
                "etely different",
                "something completely ",
                "And now so",
            };
            var expected = "And now something completely different";

            var result = "";

            for (var i = 0; i < lines.Count; i++)
            {
                result = TwoStrings.Merge(lines[i], result);
            }

            Assert.Equal(expected, result);
        }
Exemplo n.º 8
0
        public void Run()
        {
            PrintProblem();

            List <string> results = new List <string>(0);

            Console.WriteLine("number of test cases:");
            p = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < p; i++)
            {
                results.Add(TwoStrings.twoStrings(Console.ReadLine(),
                                                  Console.ReadLine()));
            }

            Console.WriteLine();
            Console.WriteLine("Result:");
            foreach (string result in results)
            {
                Console.WriteLine(result);
            }
            Console.ReadKey();
        }
Exemplo n.º 9
0
        public void TwoStringsTest6()
        {
            string result = TwoStrings.twoStrings("bbbbbbbbbbbbbxcdtvfygbuhnbvgcfytdxcfvygubhniibguvcfdtxtcfyvgbuhnijhbvcytxtcdfyvgbuhnihvycdtxdctfvygbuhnibuvctxeyvbuinbyuvtctxrctvfygbuniyuvtctxddcfyvbuniybuyrcdtfvygvctextfvygubhbgvfcdtxcfyvgubvyctxfvygbuhnia", "a");

            Assert.AreEqual(YES, result);
        }
Exemplo n.º 10
0
        public void MergeTest(string a, string b, string expected)
        {
            var actual = TwoStrings.Merge(a, b);

            Assert.Equal(expected, actual);
        }
    public MyControl()
    {
        InitializeComponent();

        this.DataContext = TsObj = new TwoStrings();
    }
Exemplo n.º 12
0
 public void Initialize()
 {
     _twoStrings = new TwoStrings();
 }
Exemplo n.º 13
0
        public void TwoStringsTest1()
        {
            string result = TwoStrings.twoStrings("hello", "world");

            Assert.AreEqual(YES, result);
        }
Exemplo n.º 14
0
        public void TwoStringsTest3()
        {
            string result = TwoStrings.twoStrings("", "world");

            Assert.AreEqual(NO, result);
        }
Exemplo n.º 15
0
        public void SaveSharedResources()
        {
            string foo = "Foo";
            TwoStrings value = new TwoStrings() { A = foo, B = foo };

            Dom dom = Dom.Serialise(value);

            string output = dom.Save();
            string expected = "R[\n  0: String \"Foo\"\n]\nSaveTest+TwoStrings {\n  A: #0,\n  B: #0\n}";

            Assert.AreEqual(expected, output);
        }
Exemplo n.º 16
0
        public void TwoStringsTest4()
        {
            string result = TwoStrings.twoStrings("aaa", "aaaaaaaa");

            Assert.AreEqual(YES, result);
        }
Exemplo n.º 17
0
        public void TwoStringsTest5()
        {
            string result = TwoStrings.twoStrings("iebvnpiuebvnioejncpubyo39pfq0843pubgnoipvf0837c9g86tfi3fy8u9j0", "bvnerumiw«v'9087g0hu543g0'87h038ho4uf+0'8hc4738o7fg9py438ofuhyo379fh3o87g");

            Assert.AreEqual(YES, result);
        }