示例#1
0
        public void WhenGetStringByAssembly_IfResourceNotFound_ShouldThrow()
        {
            // Act
            MockWebApplication app = new MockWebApplication();

            app.SetReturnValueForGetString("");
            WebResourceReader reader = new WebResourceReader(app);

            // Assert
            ExceptionAssert.Throws <WebTestException>(
                () => reader.GetString((Assembly)Assembly.GetExecutingAssembly(), "", ""));
        }
示例#2
0
        public void ThrowErrorIfGetStringReturnsEmptyString()
        {
            MockWebApplication app = new MockWebApplication();
            List <string>      asm = new List <string> {
                "System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            };

            app.SetReferencedAssemblies(asm);
            app.SetReturnValueForGetString(String.Empty);
            WebResourceReader reader = new WebResourceReader(app);

            reader.GetString("System.Web.Extensions", "", "");
        }