예제 #1
0
        public void Test_Failed_State_Draft_And_Publish_And_Publish()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Publish();
            candidate.Publish();
        }
예제 #2
0
        public void Test_StatusOn_Create_And_Publish()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Publish();

            AssertActiveState(candidate);
        }
예제 #3
0
        public void Test_StatusOn_Create_And_Publish_And_Delete()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Publish();
            candidate.SoftDelete();

            AssertDeletedState(candidate);
        }
예제 #4
0
        public void Test_StatusOn_Create_And_Publish_And_Archive()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Publish();
            candidate.Archive();

            AssertArchivedState(candidate);
        }
예제 #5
0
        public void Test_Object_After_Activate()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Publish();

//          Assert.IsNull(candidate.PublishedBy);
            Assert.IsNotNull(candidate.PublishedOn);
        }
예제 #6
0
        public void Bitfinex_SupportedPairs_Complete()
        {
            Assert.That(TestCandidate.SupportedTradingPairs.Count == 3);

            Assert.That(TestCandidate.IsTradingPairSupported(new TradingPair(Currency.BTC, Currency.USD)));
            Assert.That(TestCandidate.IsTradingPairSupported(new TradingPair(Currency.LTC, Currency.USD)));
            Assert.That(TestCandidate.IsTradingPairSupported(new TradingPair(Currency.LTC, Currency.BTC)));
            Assert.That(TestCandidate.DefaultPair == new TradingPair(Currency.BTC, Currency.USD));
        }
예제 #7
0
        public void Test_Failed_State_Draft_And_Publish_And_Archive_And_Activate_AndActivate()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Publish();
            candidate.Archive();

            candidate.Activate();
            candidate.Activate();
        }
예제 #8
0
        static void Main(string[] args)
        {
            while (true)
            {
                try
                {
                    Console.WriteLine("Введите: Имя (не пустая строка)");
                    var _name = Console.ReadLine();

                    Console.WriteLine("Вес в кг (целое число, больше 0)");
                    var _weight = Console.ReadLine();

                    Console.WriteLine("Рост в см (целое число, больше 0)");
                    var _growth = Console.ReadLine();

                    Console.WriteLine("Возраст (целое число, больше 0)");
                    var _age = Console.ReadLine();

                    Console.WriteLine("Зрение (дробное число, от 0 до 1)");
                    var _eye = Console.ReadLine();

                    Console.WriteLine("Разделённый пробелами список вредных привычек и болезней (может быть пустым)");
                    var _troubles = Console.ReadLine();

                    var candidate = new Candidate(_name, _weight, _growth, _age, _eye, _troubles);

                    Diagnostic.Run(candidate);

                    var results = TestCandidate.Run(candidate).ToList();

                    if (results.Any(r => r.Value == MarkEnum.unsatisfactorily) || results.Where(r => r.Value == MarkEnum.satisfactorily).Count() >= 3)
                    {
                        Console.WriteLine($"Кандидат {candidate.name} не прошел тестирование");
                        Console.WriteLine("Проблемы:");
                        results.Where(r => r.Value != MarkEnum.good)
                        .ToList()
                        .ForEach(r => { Console.WriteLine(r.Comment); });
                    }
                    else
                    {
                        Console.WriteLine($"Кандидат {candidate.name} подходит");
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
                Console.WriteLine("Протестировать других кандидатов? (y/n)");
                if (Console.ReadLine() != "y")
                {
                    return;
                }
                Console.WriteLine();
            }
        }
예제 #9
0
        private static void AssertDeletedState(TestCandidate candidate)
        {
            Assert.IsTrue(candidate.IsDeleted);

            Assert.IsFalse(candidate.IsAlive);
            Assert.IsFalse(candidate.IsActive);
            Assert.IsFalse(candidate.IsArchived);
            Assert.IsFalse(candidate.IsDraft);

            Assert.IsTrue(candidate.isStateValid());
        }
예제 #10
0
        public void Test_Object_onCreate()
        {
            TestCandidate candidate = new TestCandidate();

            Assert.IsNull(candidate.PublishedBy);
            Assert.IsNull(candidate.PublishedOn);

            Assert.IsNull(candidate.TrueFalse1);
            Assert.IsNull(candidate.TrueFalse2);
            Assert.IsNull(candidate.Integer1);
            Assert.IsNull(candidate.Integer2);
            Assert.IsNull(candidate.Text1);
            Assert.IsNull(candidate.Text2);
            Assert.IsNull(candidate.Text3);
            Assert.IsNull(candidate.Text4);
        }
예제 #11
0
        public void Test_Failed_State_Draft_And_Archive()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Archive();
        }
예제 #12
0
        public void Test_StatusOn_Create()
        {
            TestCandidate candidate = new TestCandidate();

            AssertDraftState(candidate);
        }