Beispiel #1
0
        public void SwapOddEvenBits(string xB, string expected)
        {
            var x      = Convert.ToInt32(xB, 2);
            var xp     = SwapBits.SwapOddEvenBits(x);
            var actual = Convert.ToString(xp, 2);

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
 public void DigitalRoot()
 {
     var answer = SwapBits.topNCompetitors(5, 2, new List <string> {
         "anacell", "betacell", "deltacellular", "eruocell", "centracular"
     },
                                           5, new List <string> {
         "I love anacell Best services provided by anacell in the town", "betacell has great services", "deltacellular provides much better services than betacell",
         "betacell is better than than deltacellular"
     });
 }
Beispiel #3
0
 public void SwapBitsTest()
 {
     var answer = SwapBits.SwapBitsByPosition(5, 1, 2);
 }
Beispiel #4
0
 public void TestRemoveLastBit()
 {
     SwapBits.TestREmoveLastBit(5);
 }
Beispiel #5
0
 public void SwapBits_Smoke_Test()
 {
     Assert.AreEqual(227, SwapBits.Swap(47, 1, 5, 3));
     Assert.AreEqual(7, SwapBits.Swap(28, 0, 3, 2));
 }