public static void GetScriptUri_ThrowsArgumentNullException_ForNullPath()
        {
            // Arrange
            var provider = new DefaultAssetProvider();

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => provider.GetScriptUri(null));
        }
示例#2
0
        private static void InitializeDefault()
        {
            // Use the default provider. WARNING: Don't forget to initialize it too!
            var tmpProvider = new DefaultAssetProvider();

            tmpProvider.Initialize(null, null);

            var tmpProviders = new AssetProviderCollection();

            tmpProviders.Add(tmpProvider);
            tmpProviders.SetReadOnly();

            s_Providers = tmpProviders;
            s_Provider  = tmpProvider;
        }
        public static void GetScriptUri_ReturnsBasePath_ForEmptyPath()
        {
            AppDomainUtils.RunInSeparateAppDomain(() =>
            {
                AspNetHelpers.SetupAspNetDomain();

                using (var _ = AspNetHelpers.CreateHttpContext())
                {
                    // Arrange
                    var provider = new DefaultAssetProvider();

                    // Act
                    var uri = provider.GetScriptUri(String.Empty);

                    // Act & Assert
                    Assert.Equal("/Scripts/", uri.ToString());
                }
            });
        }