public void UrlTest()
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();
            var filename = "filename";

            target.Filename = filename;
            Assert.AreEqual("http://www.zuehlke.com/uploads/tx_zepublications/" + filename, target.Url);
        }
        public void Xps2LoadingTest()
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();

            new CultureHelper().RegisterLanguage();
            target.FilepathXps = XpsPath;
            target.LoadDocument();
            Assert.IsNotNull(target.Document);
        }
        public void UrlTest()
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();

            target.Filename = "bla.pdf";
            var expected = "http://www.zuehlke.com/uploads/tx_zepublications/bla.pdf";

            Assert.AreEqual(expected, target.Url);
        }
        public void DocumentTest()
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();

            target.FilepathXps = @"..\..\..\ProjectFlip.Services.Test\Resources\Xps\pn_test.xps";
            IDocumentPaginatorSource document;

            document = target.Document;
            Assert.IsNotNull(document);
        }
        public void ImageTest()
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();

            target.FilepathImage = @"..\..\..\ProjectFlip.Services.Test\Resources\Image\pn_test.bmp";
            BitmapImage image;

            image = target.Image;
            Assert.IsNotNull(image);
        }
        private static BitmapImage GetBitmapImage(string path)
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();

            target.FilepathImage = path;
            BitmapImage image;

            image = target.Image;
            return(image);
        }
Esempio n. 7
0
        public void ImageLoadingTest()
        {
            var target = new ProjectNote_Accessor();

            target.FilepathImage = ImagePath;
            Assert.IsNotNull(target.Image);

            target.FilepathImage = "blablabla";
            Assert.IsNull(target.Image);
        }
        public void ConvertToListTest()
        {
            string         line     = "test";
            IList <string> expected = new List <string>();

            expected.Add(line);
            IList <string> actual;

            actual = ProjectNote_Accessor.ConvertToList(line);
            Assert.AreEqual(expected.Count, actual.Count);
            for (int i = 0; i < expected.Count; i++)
            {
                Assert.AreEqual(expected[0], actual[i]);
            }
        }
Esempio n. 9
0
        public void XpsLoadingTest()
        {
            var target = new ProjectNote_Accessor();

            new CultureHelper().RegisterLanguage();
            target.FilepathXps = XpsPath;

            Assert.IsNull(target.Document);
            Dispatcher.ExitAllFrames();
            Thread.SpinWait(19999);

            Assert.IsNull(target.Document);
            Assert.IsInstanceOfType(target, typeof(INotifyPropertyChanged));
            // Test the async loading and INotifyPropertyChanged... e.g. with DispatcherHelper
        }
        public void XpsLoadingTest()
        {
            ProjectNote_Accessor target = new ProjectNote_Accessor();

            new CultureHelper().RegisterLanguage();
            target.FilepathXps = XpsPath;

            var t = new Thread(new ThreadStart(() =>
            {
                var a = new Application();
                new CultureHelper().RegisterLanguage();
                a.Run();
            }));

            t.Start();
            Thread.Sleep(1000);

            Assert.IsNull(target.Document);
        }