예제 #1
0
        public void ICardAddImagePerformanceTest()
        {
            TestInfrastructure.DebugLineStart(TestContext);
            IMedia media;

            if (TestInfrastructure.IsActive(TestContext))
            {
                using (IDictionary writeLM = TestInfrastructure.GetLMConnection(TestContext, TestInfrastructure.GetAdminUser))
                {
                    Tools.TestStopWatch.Start(TestContext);
                    ICard  card      = writeLM.Cards.AddNew();
                    string testImage = TestInfrastructure.GetLargeTestImage();
                    media = card.CreateMedia(EMedia.Image, testImage, true, true, true);
                    card.AddMedia(media, Side.Question);
                    Assert.AreEqual(1, card.QuestionMedia.Count, "ICard doesn't save a QuestionMedia (image) with the method 'card.AddMedia(Media, Side.Question)'");
                    Assert.AreEqual(0, card.AnswerMedia.Count, "ICard saves a QuestionMedia (image) to an AnswerMedia");
                    card.ClearAllMedia();
                    Tools.TestStopWatch.Stop(TestContext);
                    try { File.Delete(testImage); }
                    catch { }
                }
            }

            TestInfrastructure.DebugLineEnd(TestContext);
        }