Пример #1
0
        public void TestToData()
        {
            var testSubject = Personality.RandomPersonality();
            var testResult  = testSubject.ToData(KindsOfTextCase.Kabab);

            Assert.IsNotNull(testResult);
            Assert.AreNotEqual(0, testResult.Count);
            foreach (var k in testResult.Keys)
            {
                Console.WriteLine($"{k}: {testResult[k]}");
            }
        }
Пример #2
0
        public void TestEquals()
        {
            var testSubject00 = Personality.RandomPersonality();
            var testSubject01 = Personality.RandomPersonality();

            testSubject01.Agreeableness.Value     = testSubject00.Agreeableness.Value;
            testSubject01.Conscientiousness.Value = testSubject00.Conscientiousness.Value;
            testSubject01.Extraversion.Value      = testSubject00.Extraversion.Value;
            testSubject01.Neuroticism.Value       = testSubject00.Neuroticism.Value;
            testSubject01.Openness.Value          = testSubject00.Openness.Value;

            Assert.IsTrue(testSubject00.Equals(testSubject01));
        }
Пример #3
0
        public void TestGetRandomActsIrresponsible()
        {
            var testSubject = Personality.RandomPersonality();

            testSubject.Conscientiousness.Value = new Dimension(0.99, 0.10);

            //given normal dist it should always be false
            for (var i = 0; i < 100; i++)
            {
                Assert.IsFalse(testSubject.GetRandomActsIrresponsible());
            }

            testSubject.Conscientiousness.Value = new Dimension(-0.99, 0.10);
            //now the same only always true
            for (var i = 0; i < 100; i++)
            {
                Assert.IsTrue(testSubject.GetRandomActsIrresponsible());
            }
        }