Esempio n. 1
0
        public void ExceptionTest()
        {
            Actress obj = null;
            string  stringifiedProperties = obj.StringifyProperties();

            Assert.IsTrue(stringifiedProperties.Contains("Failed to stringify properties"));
        }
Esempio n. 2
0
        public void PerformanceTest()
        {
            const int    ITERATIONS = 1000;
            const double MAX_ALLOWED_TIME_IN_MILLISECONDS = 100;

            var actress = new Actress
            {
                Name      = "Fernanda Montenegro",
                Age       = 90,
                BirthDate = new DateTime(1929, 10, 16)
            };

            var stw = Stopwatch.StartNew();

            for (int i = 0; i < ITERATIONS; i++)
            {
                actress.StringifyProperties();
            }
            stw.Stop();
            Assert.That(stw.ElapsedMilliseconds, Is.LessThan(MAX_ALLOWED_TIME_IN_MILLISECONDS));
        }
Esempio n. 3
0
 public void Setup()
 {
     _actress = ActressFactory.GetActress();
 }