示例#1
0
        public void CheckFalseCases()
        {
            //var uni = new Unique();
            bool actual = Chapter1.unique("ABCDEFGA");

            Assert.AreEqual(false, actual);
        }
示例#2
0
        public void CheckCaseTrueCases()
        {
            //var uni = new Unique();
            bool actual = Chapter1.unique("ABCDEFGa");

            Assert.AreEqual(true, actual);
        }
        static void Main(string[] args)
        {
            IChapter chapter = new Chapter1();

            chapter.Experiment();
            Console.Read();
        }
        public void lgTest()
        {
            int    actual   = Chapter1.lg(8);
            int    expected = 3;
            string message  = "expected: " + expected.ToString() + " actual: " + actual.ToString();

            Assert.AreEqual(expected, actual, message);
        }
示例#5
0
    void Start()
    {
        Chapter chapter1 = new Chapter1();

        _gameEngine = new GameEngine(new Chapter[] { chapter1 });

        noticedInteractableController = null;
    }
示例#6
0
        static void Main(string[] args)
        {
            var chapter1 = new Chapter1();

            chapter1.Lesson4();

            Console.WriteLine();
        }
            public void Should_DisposeDisposable()
            {
                var disposable = new BooleanDisposable();

                var result = Chapter1.Using(disposable, GetDisposed);

                result.Should().BeFalse();

                disposable.IsDisposed.Should().BeTrue();
            }
示例#8
0
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");
            //var chapter = new Chapter1();
            //chapter.Lesson4();

            Chapter1.Lesson1();

            Console.ReadKey();
        }
示例#9
0
        static void Main(string[] args)
        {
            var chapter = new Chapter1();

            chapter.Lesson4();

            BitcoinSecret paymentSecret = chapter.paymentSecret;

            Console.WriteLine("\n\n\nPress enter to continue.");
            Console.ReadLine();
        }
示例#10
0
        static void Main(string[] args)
        {
            var chapter = new Chapter1();

            chapter.Lesson1();
            chapter.Lesson2();
            chapter.Lesson3();
            //chapter.lesson4();

            Console.WriteLine("\n\n\nPress enter to continue");
            Console.ReadLine();
        }
        public void PowTest()
        {
            double y = 3;

            for (int i = 0; i < 1000; i++)
            {
                int    expected = (int)Math.Pow((double)i, y);
                int    actual   = Chapter1.Pow(i, (int)y);
                string message  = "expected :" + expected.ToString() + " actual: " + actual.ToString();
                Assert.AreEqual(expected, actual, message);
            }
        }
示例#12
0
        static void Main(string[] args)
        {
            //Select the chapter here.
            var chapter = new Chapter1();

            //call the lesson here.
            chapter.Lesson4();

            //this will hold the window open for you to read the output.
            Console.WriteLine("\n\n\nPress enter to continue.");
            Console.ReadLine();
        }
示例#13
0
        static void Main(string[] args)
        {
            // select the chapter here
            var chapter = new Chapter1();

            // call the lesson here
            chapter.Lesson1();
            chapter.Lesson2(chapter.ScriptPubkeyValue);

            // this will hold the window open for you to read the output
            Console.WriteLine("\n\n\nPress enter to continue.");
            Console.ReadLine();
        }
示例#14
0
        public void IsUnique2_WithAnyStringFalse_ShouldReturnFalse()
        {
            // arrange
            //var FakeChapter1 = Substitute.For<IChapter1>();
            //FakeChapter1.isUniqueString(Arg.Any<string>()).Returns(false);

            IChapter1 chap1 = new Chapter1(); // Injecting Real Dependency

            // act
            //IsUniqueClient client = new IsUniqueClient(FakeChapter1); // Injecting a 'Fake' Dependency
            IsUniqueClient client = new IsUniqueClient(chap1);

            // assert
            Assert.AreEqual(client.isUnique2("hello"), 2);
        }
示例#15
0
        static void Main(string[] args)
        {
            //Select the chapter here.
            var chapter = new Chapter1();

            //call the lesson here.
            chapter.Lesson1();
            chapter.Lesson2();
            chapter.Lesson3();
            chapter.Lesson4();

            BitcoinSecret paymentSecret = new BitcoinSecret("L2kB44pEZjMtnrNEjJwp3kvo5toGyu9Hmieq5v8xuXD1UPuXEPUp");

            //this will hold the window open for you to read the output.
            Console.WriteLine("\n\n\nPress enter to continue.");
            Console.ReadLine();
        }
示例#16
0
    private static void TestChapter1()
    {
        Console.WriteLine("Question 1");
        Console.WriteLine(Chapter1.Question1("abc"));
        Console.WriteLine(Chapter1.Question1("abbc"));

        Console.WriteLine("Question 2");
        Console.WriteLine(Chapter1.Question2("abc", "bca"));
        Console.WriteLine(Chapter1.Question2("abc", "bda"));

        Console.WriteLine("Question 3");
        Console.WriteLine(Chapter1.Question3("a b c"));

        Console.WriteLine("Question 4");
        Console.WriteLine(Chapter1.Question4("ttaacoc"));
        Console.WriteLine(Chapter1.Question4("ttadacoc"));
    }
        public void IsEvenTest()
        {
            // Create a list of integers, which are even, to determine if the function (IsEven) truly tests if an integer is even or odd.
            int[] evenIntList = new int[100];
            for (int i = 0; i < evenIntList.Length; i++)
            {
                evenIntList[i] = 2 * i;
            }

            for (int i = 0; i < evenIntList.Length; i++)
            {
                int actualEven = evenIntList[i];
                Assert.IsTrue(Chapter1.IsEven(actualEven), actualEven.ToString());

                int actualOdd = evenIntList[i] + 1;
                Assert.IsFalse(Chapter1.IsEven(actualOdd), actualOdd.ToString());
            }
        }
        static void Main(string[] args)
        {
            //Select the chapter here.
            var chapter1 = new Chapter1();//call the lesson here.

            var script = chapter1.Lesson1(paymentSecret);

            chapter1.Lesson2(script);
            chapter1.Lesson3(script);


            //var chapter2 = new Chapter2();

            //chapter2.Lesson1(new uint256("4ebf7f7ca0a5dafd10b9bd74d8cb93a6eb0831bcb637fec8e8aabf842f1c2688"));



            //this will hold the window open for you to read the output.
            Console.WriteLine("\n\n\nPress enter to continue.");
            Console.ReadLine();
        }
示例#19
0
 static void Chap1()
 {
     Chapter1 chapter1 = new Chapter1();
 }
        public void LogBase2Test()
        {
            int actual = Chapter1.LogBase2(8);

            Assert.AreEqual(3, actual, actual.ToString());
        }
示例#21
0
 public Chapter1Tests()
 {
     _testHelper = new Chapter1();
 }
示例#22
0
 public static void Main(string[] args)
 {
     Console.WriteLine(Chapter1.unique("ABCDa"));
     Console.WriteLine(string.Join(" ", Chapter1.FindPermutations("AB")));
     Console.WriteLine(Chapter1.Escape_spaces("This is sample"));
 }
示例#23
0
        public void CheckEscapeSpaces()
        {
            string actual = Chapter1.Escape_spaces("This is Sample");

            Assert.AreEqual("This%20is%20Sample", actual);
        }