コード例 #1
0
        public void TestUnsupportedAttachments()
        {
            var unsupported = TestUtils.CreateAttachment("unsupported.vsd", "unsupported.vsd", "1");

            var model = new ProtectTaskPaneModel();
            model.AddAttachment(unsupported);
            var cache = new AttachmentsModelCache(model);

            bool attachmentAdded = false;
            model.StatusUpdate += (sender, args) =>
                                      {
                                          attachmentAdded = true;
                                      };

            SpinWait.SpinUntil(() => attachmentAdded, 30000);

            cache.ResetCache();
            Assert.IsTrue(cache.AnyAttachmentsOf(SearchModel.UnSupported));
        }
コード例 #2
0
        public void TestAnyAttachmentsOfPasswordProtected()
        {
            var passwordProtected = TestUtils.CreateAttachment("password.pptx", "password.pptx", "1");
            
            var model = new ProtectTaskPaneModel();
            model.AddAttachment(passwordProtected);
            var cache = new AttachmentsModelCache(model);

            bool attachmentAdded = false;
            model.StatusUpdate += (sender, args) =>
            {
                attachmentAdded = true;
            };

            SpinWait.SpinUntil(() => attachmentAdded, 30000);

            cache.ResetCache();

            Assert.IsTrue(cache.AnyAttachmentsOf(SearchModel.PasswordProtected));
        }