Exemplo n.º 1
0
            public void ClearsTheCache()
            {
                var urlLocator  = new UrlLocator();
                var resolvedUrl = urlLocator.ResolveUrl(typeof(PersonViewModel), false);

                Assert.IsNotNull(resolvedUrl);
                Assert.AreEqual("/Views/Person.xaml", resolvedUrl);

                // Clear the naming conventions (so it *must* come from the cache)
                urlLocator.NamingConventions.Clear();

                resolvedUrl = urlLocator.ResolveUrl(typeof(PersonViewModel), false);

                Assert.IsNotNull(resolvedUrl);
                Assert.AreEqual("/Views/Person.xaml", resolvedUrl);

                // Clear the cache, now it should break
                urlLocator.ClearCache();

                resolvedUrl = urlLocator.ResolveUrl(typeof(PersonViewModel), false);

                Assert.IsNull(resolvedUrl);
            }
Exemplo n.º 2
0
            public void ThrowsArgumentNullExceptionForNullViewType()
            {
                var urlLocator = new UrlLocator();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => urlLocator.ResolveUrl(null));
            }