Reformat code

This commit is contained in:
2023-06-01 04:17:16 +02:00
parent 23bfda2d75
commit ef92878cbd
53 changed files with 975 additions and 523 deletions

View File

@@ -7,7 +7,7 @@ namespace VAR.WebFormsCore.Tests.Code;
public class ExtensionMethodsTests
{
#region GetRequestParameter
[Fact]
public void GetRequestParameter__EmptyGet__Empty()
{
@@ -15,11 +15,11 @@ public class ExtensionMethodsTests
string key = "Key";
string result = fakeWebContext.GetRequestParameter(key);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal(string.Empty, result);
}
[Fact]
public void GetRequestParameter__EmptyPost__Empty()
{
@@ -27,11 +27,11 @@ public class ExtensionMethodsTests
string key = "Key";
string result = fakeWebContext.GetRequestParameter(key);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal(string.Empty, result);
}
[Fact]
public void GetRequestParameter__QueryKeyGet__CorrectValue()
{
@@ -41,11 +41,11 @@ public class ExtensionMethodsTests
fakeWebContext.RequestQuery.Add(key, value);
string result = fakeWebContext.GetRequestParameter(key);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal(value, result);
}
[Fact]
public void GetRequestParameter__FormKeyPost__CorrectValue()
{
@@ -53,9 +53,9 @@ public class ExtensionMethodsTests
string key = "Key";
string value = "Value";
fakeWebContext.RequestForm.Add(key, value);
string result = fakeWebContext.GetRequestParameter(key);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal(value, result);
}
@@ -70,11 +70,11 @@ public class ExtensionMethodsTests
fakeWebContext.RequestQuery.Add(keyInvalid, value);
string result = fakeWebContext.GetRequestParameter(key);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal(string.Empty, result);
}
[Fact]
public void GetRequestParameter__OtherFormKeyPost__Empty()
{
@@ -83,15 +83,15 @@ public class ExtensionMethodsTests
string key = "Key";
string value = "Value";
fakeWebContext.RequestForm.Add(keyInvalid, value);
string result = fakeWebContext.GetRequestParameter(key);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal(string.Empty, result);
}
#endregion GetRequestParameter
#region ResponseObject
[Fact]
@@ -105,6 +105,6 @@ public class ExtensionMethodsTests
Assert.Single(fakeWebContext.FakeWritePackages);
Assert.Equal("{ }", fakeWebContext.FakeWritePackages[0].ToString());
}
#endregion ResponseObject
}

View File

@@ -13,15 +13,17 @@ public class ObjectActivatorTests
Assert.IsType<object>(result);
}
private class TestType { }
private class TestType
{
}
[Fact]
public void CreateInstance__TestType__TestType()
{
object result = ObjectActivator.CreateInstance(typeof(TestType));
Assert.IsType<TestType>(result);
object result2 = ObjectActivator.CreateInstance(typeof(TestType));
Assert.IsType<TestType>(result2);

View File

@@ -11,12 +11,12 @@ public class ScriptsBundlerTests
{
FakeWebContext fakeWebContext = new();
ScriptsBundler scriptsBundler = new();
scriptsBundler.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Single(fakeWebContext.FakeWritePackages);
// TODO: Verify contents of intrinsic scripts
}
}

View File

@@ -6,97 +6,97 @@ namespace VAR.WebFormsCore.Tests.Code;
public class ServerHelperTests
{
#region MapContentPath
[Fact]
public void MapContentPath__Empty__Slash()
{
ServerHelpers.SetContentRoot(string.Empty);
string result = ServerHelpers.MapContentPath(string.Empty);
Assert.Equal("/", result);
}
[Fact]
public void MapContentPath__File__SlashFile()
{
ServerHelpers.SetContentRoot(string.Empty);
string result = ServerHelpers.MapContentPath("file.ext");
Assert.Equal("/file.ext", result);
}
[Fact]
public void MapContentPath__FileWithRoot__AbsolutePathToFile()
{
ServerHelpers.SetContentRoot("/opt/App");
string result = ServerHelpers.MapContentPath("file.ext");
Assert.Equal("/opt/App/file.ext", result);
}
#endregion MapContentPath
#region HtmlEncode
[Fact]
public void HtmlEncode__Empty__Empty()
{
string result = ServerHelpers.HtmlEncode(string.Empty);
Assert.Equal(string.Empty, result);
}
[Fact]
public void HtmlEncode__SafeString__SameString()
{
string text = "aA0, ()!?=\\-_*+";
string result = ServerHelpers.HtmlEncode(text);
Assert.Equal(text, result);
}
[Fact]
public void HtmlEncode__UnsafeString__SafeString()
{
string text = "<<>>\"'&\u00FF";
string safeText = "&lt;&lt;&gt;&gt;&quot;&#39;&amp;&#255;";
string result = ServerHelpers.HtmlEncode(text);
Assert.Equal(safeText, result);
}
#endregion HtmlEncode
#region UrlEncode
[Fact]
public void UrlEncode__Empty__Empty()
{
string result = ServerHelpers.UrlEncode(string.Empty);
Assert.Equal(string.Empty, result);
}
[Fact]
public void UrlEncode__SafeString__SameString()
{
string text = "aA0()!-_*";
string result = ServerHelpers.UrlEncode(text);
Assert.Equal(text, result);
}
[Fact]
public void UrlEncode__UnsafeString__SafeString()
{
string text = "<< >>\"' + &\u00FF";
string safeText = "%3C%3C+%3E%3E%22%27+%2B+%26%FF";
string result = ServerHelpers.UrlEncode(text);
Assert.Equal(safeText, result);
}

View File

@@ -11,12 +11,12 @@ public class StylesBundlerTests
{
FakeWebContext fakeWebContext = new();
StylesBundler stylesBundler = new();
stylesBundler.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Single(fakeWebContext.FakeWritePackages);
// TODO: Verify contents of intrinsic styles
}
}

View File

@@ -11,47 +11,47 @@ public class UnitTests
Unit unit = new(100, UnitType.Pixel);
string result = unit.ToString();
Assert.Equal("100px", result);
}
[Fact]
public void ToString__50px__50px()
{
Unit unit = new(100, UnitType.Pixel);
string result = unit.ToString();
Assert.Equal("100px", result);
}
[Fact]
public void ToString__100pc__100pc()
{
Unit unit = new(100, UnitType.Percentage);
string result = unit.ToString();
Assert.Equal("100%", result);
}
[Fact]
public void ToString__50pc__50pc()
{
Unit unit = new(100, UnitType.Percentage);
string result = unit.ToString();
Assert.Equal("100%", result);
}
[Fact]
public void ToString__100UnknownUnits__Empty()
{
Unit unit = new(100, (UnitType)1000);
string result = unit.ToString();
Assert.Equal(string.Empty, result);
}
}

View File

@@ -22,7 +22,7 @@ public class ButtonTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(@"<input type=""submit"" class=""button"" value=""""></input>", result);
}
[Fact]
public void MustRenderCorrectly__WithOnClientClick()
{
@@ -41,7 +41,7 @@ public class ButtonTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(@"<input type=""submit"" class=""button"" value="""" onclick=""alert(1)""></input>", result);
}
[Fact]
public void MustRenderCorrectly__ClickWithCommandArgument()
{
@@ -53,10 +53,7 @@ public class ButtonTests
CommandArgument = commandArgument,
};
string? result = null;
button.Click += (o, _) =>
{
result = (o as Button)?.CommandArgument;
};
button.Click += (o, _) => { result = (o as Button)?.CommandArgument; };
page.Controls.Add(button);
fakeWebContext.RequestForm.Add(button.ClientID, "Clicked");

View File

@@ -8,7 +8,7 @@ namespace VAR.WebFormsCore.Tests.Controls;
public class CTextBoxTests
{
#region MustRenderCorrectly
[Fact]
public void MustRenderCorrectly()
{
@@ -36,11 +36,11 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
CssClassExtra = "extraClass",
PlaceHolder = "Placeholder",
CssClassExtra = "extraClass",
PlaceHolder = "Placeholder",
MarkedInvalid = true,
TextMode = TextBoxMode.Normal,
AllowEmpty = true,
TextMode = TextBoxMode.Normal,
AllowEmpty = true,
KeepSize = true,
Text = "Test",
};
@@ -57,7 +57,7 @@ public class CTextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__WithNextFocusOnEnter()
{
@@ -80,19 +80,19 @@ public class CTextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__WithChangedText()
{
string text = "Test";
string changedValue = "Changed";
FakeWebContext fakeWebContext0 = new();
Page page0 = new();
CTextBox cTextBox0 = new() { Text = text };
page0.Controls.Add(cTextBox0);
page0.ProcessRequest(fakeWebContext0);
FakeWebContext fakeWebContext1 = new(requestMethod: "POST");
fakeWebContext1.RequestForm.Add(cTextBox0.TxtContent.ClientID, changedValue);
Page page1 = new();
@@ -110,7 +110,7 @@ public class CTextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly_Multiline()
{
@@ -118,7 +118,7 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
TextMode = TextBoxMode.MultiLine,
TextMode = TextBoxMode.MultiLine,
KeepSize = true,
};
page.Controls.Add(cTextBox);
@@ -146,7 +146,7 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
TextMode = TextBoxMode.MultiLine,
TextMode = TextBoxMode.MultiLine,
KeepSize = true,
};
page.Controls.Add(cTextBox);
@@ -168,7 +168,7 @@ public class CTextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly_Multiline__GetAndSetClientsideHeight__100()
{
@@ -176,7 +176,7 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
TextMode = TextBoxMode.MultiLine,
TextMode = TextBoxMode.MultiLine,
KeepSize = true,
};
page.Controls.Add(cTextBox);
@@ -214,15 +214,12 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
TextMode = TextBoxMode.MultiLine,
TextMode = TextBoxMode.MultiLine,
KeepSize = true,
};
page.Controls.Add(cTextBox);
Button button = new();
button.Click += (_, _) =>
{
cTextBox.SetClientsideHeight(null);
};
button.Click += (_, _) => { cTextBox.SetClientsideHeight(null); };
page.Controls.Add(button);
fakeWebContext.RequestForm.Add(button.ClientID, "Clicked");
@@ -243,7 +240,7 @@ public class CTextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly_Multiline__GetClientsideHeightInjectArray__Null()
{
@@ -251,17 +248,14 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
TextMode = TextBoxMode.MultiLine,
TextMode = TextBoxMode.MultiLine,
KeepSize = true,
};
page.Controls.Add(cTextBox);
Button button = new();
button.Click += (_, _) =>
{
if (cTextBox.HidSize != null)
{
cTextBox.HidSize.Value = "[]";
}
if (cTextBox.HidSize != null) { cTextBox.HidSize.Value = "[]"; }
};
page.Controls.Add(button);
@@ -273,7 +267,7 @@ public class CTextBoxTests
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
Assert.Equal("text/html", fakeWebContext.ResponseContentType);
}
[Fact]
public void MustRenderCorrectly_Multiline__GetClientsideHeightInjectObject__Null()
{
@@ -281,17 +275,14 @@ public class CTextBoxTests
Page page = new();
CTextBox cTextBox = new()
{
TextMode = TextBoxMode.MultiLine,
TextMode = TextBoxMode.MultiLine,
KeepSize = true,
};
page.Controls.Add(cTextBox);
Button button = new();
button.Click += (_, _) =>
{
if (cTextBox.HidSize != null)
{
cTextBox.HidSize.Value = "{}";
}
if (cTextBox.HidSize != null) { cTextBox.HidSize.Value = "{}"; }
};
page.Controls.Add(button);
@@ -314,17 +305,17 @@ public class CTextBoxTests
CTextBox cTextBox = new() { Text = string.Empty, };
bool result = cTextBox.IsEmpty();
Assert.True(result);
}
[Fact]
public void IsEmpty__Text__False()
{
CTextBox cTextBox = new() { Text = "Text", };
bool result = cTextBox.IsEmpty();
Assert.False(result);
}
@@ -338,17 +329,17 @@ public class CTextBoxTests
CTextBox cTextBox = new() { Text = string.Empty, AllowEmpty = false, };
bool result = cTextBox.IsValid();
Assert.False(result);
}
[Fact]
public void IsEmpty__TextAllowEmptyFalse__True()
{
CTextBox cTextBox = new() { Text = "Text", AllowEmpty = false, };
bool result = cTextBox.IsValid();
Assert.True(result);
}
@@ -358,20 +349,19 @@ public class CTextBoxTests
CTextBox cTextBox = new() { Text = string.Empty, AllowEmpty = true, };
bool result = cTextBox.IsValid();
Assert.True(result);
}
[Fact]
public void IsEmpty__TextAllowEmptyTrue__True()
{
CTextBox cTextBox = new() { Text = "Text", AllowEmpty = true, };
bool result = cTextBox.IsValid();
Assert.True(result);
}
#endregion IsEmpty
}

View File

@@ -22,7 +22,7 @@ public class HiddenFieldTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(@"<input type=""hidden"" id=""ctl00"" name=""ctl00""></input>", result);
}
[Fact]
public void MustRenderCorrectly__WithValue()
{
@@ -40,7 +40,7 @@ public class HiddenFieldTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(@"<input type=""hidden"" id=""ctl00"" name=""ctl00"" value=""Test""></input>", result);
}
[Fact]
public void MustRenderCorrectly__WithChangedValue()
{

View File

@@ -22,7 +22,7 @@ public class HtmlFormTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(@"<form method=""post"" action=""Page""></form>", result);
}
[Fact]
public void MustRenderCorrectly__WithQueryParameters()
{

View File

@@ -22,7 +22,7 @@ public class HtmlHeadTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal("<head ></head>", result);
}
[Fact]
public void MustRenderCorrectly__WithTitle()
{
@@ -39,7 +39,7 @@ public class HtmlHeadTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal("<head ><title>Test</title></head>", result);
}
[Fact]
public void MustRenderCorrectly__WithMeta()
{
@@ -54,7 +54,7 @@ public class HtmlHeadTests
HttpEquiv = "TestMetaHttpEquiv"
};
htmlHead.Controls.Add(htmlMeta);
page.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);

View File

@@ -22,7 +22,7 @@ public class HyperLinkTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal("<a ></a>", result);
}
[Fact]
public void MustRenderCorrectly__WithTextAndUrl()
{

View File

@@ -22,7 +22,7 @@ public class LiteralControlTests
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(@"", result);
}
[Fact]
public void MustRenderCorrectly__AnyContent()
{

View File

@@ -26,7 +26,7 @@ public class TextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__NormalWithText()
{
@@ -46,13 +46,13 @@ public class TextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__Password()
{
FakeWebContext fakeWebContext = new();
Page page = new();
TextBox textBox = new() {TextMode = TextBoxMode.Password, };
TextBox textBox = new() { TextMode = TextBoxMode.Password, };
page.Controls.Add(textBox);
page.ProcessRequest(fakeWebContext);
@@ -66,7 +66,7 @@ public class TextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__PasswordWithText()
{
@@ -86,13 +86,13 @@ public class TextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__MultiLine()
{
FakeWebContext fakeWebContext = new();
Page page = new();
TextBox textBox = new() {TextMode = TextBoxMode.MultiLine, };
TextBox textBox = new() { TextMode = TextBoxMode.MultiLine, };
page.Controls.Add(textBox);
page.ProcessRequest(fakeWebContext);
@@ -106,7 +106,7 @@ public class TextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__MultiLineWithText()
{
@@ -127,7 +127,7 @@ public class TextBoxTests
""",
actual: result);
}
[Fact]
public void MustRenderCorrectly__WithChangedText()
{

View File

@@ -16,10 +16,7 @@ public class FakeGlobalConfig : IGlobalConfig
private string _loginHandler = string.Empty;
public void FakeSetLoginHandler(string loginHandler)
{
_loginHandler = loginHandler;
}
public void FakeSetLoginHandler(string loginHandler) { _loginHandler = loginHandler; }
public string LoginHandler => _loginHandler;
@@ -27,18 +24,9 @@ public class FakeGlobalConfig : IGlobalConfig
private bool _authenticated;
public void FakeSetAuthenticated(bool authenticated)
{
_authenticated = authenticated;
}
public bool IsUserAuthenticated(IWebContext context)
{
return _authenticated;
}
public void FakeSetAuthenticated(bool authenticated) { _authenticated = authenticated; }
public void UserDeauthenticate(IWebContext context)
{
_authenticated = false;
}
public bool IsUserAuthenticated(IWebContext context) { return _authenticated; }
public void UserDeauthenticate(IWebContext context) { _authenticated = false; }
}

View File

@@ -5,34 +5,25 @@ namespace VAR.WebFormsCore.Tests.Fakes;
public class FakeWebContext : IWebContext
{
public FakeWebContext(string requestMethod = "GET")
{
RequestMethod = requestMethod;
}
public FakeWebContext(string requestMethod = "GET") { RequestMethod = requestMethod; }
public string RequestPath => string.Empty;
public string RequestMethod { get; }
public Dictionary<string, string?> RequestHeader { get; } = new();
public Dictionary<string, string> RequestCookies { get; } = new();
public Dictionary<string, string?> RequestQuery { get; } = new();
public Dictionary<string, string?> RequestForm { get; } = new();
public List<WritePackage> FakeWritePackages { get; } = new();
public void ResponseWrite(string text)
{
FakeWritePackages.Add(new WritePackage { Text = text, });
}
public void ResponseWrite(string text) { FakeWritePackages.Add(new WritePackage { Text = text, }); }
public void ResponseWriteBin(byte[] content)
{
FakeWritePackages.Add(new WritePackage { Bin = content, });
}
public void ResponseWriteBin(byte[] content) { FakeWritePackages.Add(new WritePackage { Bin = content, }); }
public void ResponseFlush()
{
@@ -50,30 +41,21 @@ public class FakeWebContext : IWebContext
throw new NotImplementedException();
}
public void DelResponseCookie(string cookieName)
{
throw new NotImplementedException();
}
public void DelResponseCookie(string cookieName) { throw new NotImplementedException(); }
private bool _responseHasStarted;
public void FakeSetResponseHasStarted(bool responseHasStarted)
{
_responseHasStarted = responseHasStarted;
}
public void FakeSetResponseHasStarted(bool responseHasStarted) { _responseHasStarted = responseHasStarted; }
public bool ResponseHasStarted => _responseHasStarted;
public int ResponseStatusCode { get; set; } = 200;
public string? ResponseContentType { get; set; }
public Dictionary<string, string> FakeResponseHeaders { get; } = new();
public void SetResponseHeader(string key, string value)
{
FakeResponseHeaders.Add(key, value);
}
public void SetResponseHeader(string key, string value) { FakeResponseHeaders.Add(key, value); }
public void PrepareCacheableResponse()
{
@@ -93,15 +75,9 @@ public struct WritePackage
public override string ToString()
{
if (Text != null)
{
return Text;
}
if (Text != null) { return Text; }
if (Bin == null)
{
return string.Empty;
}
if (Bin == null) { return string.Empty; }
string text = Encoding.UTF8.GetString(Bin ?? Array.Empty<byte>());
return text;
@@ -116,4 +92,4 @@ public static class WritePackageExtensions
string result = string.Join(separator, listStrings);
return result;
}
}
}

View File

@@ -11,13 +11,13 @@ public class FrmEchoTests
{
FakeWebContext fakeWebContext = new();
FrmEcho frmEcho = new();
frmEcho.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(
expected: """
expected: """
<pre><code>
Header:{ }
Query:{ }
@@ -26,20 +26,20 @@ public class FrmEchoTests
""",
actual: result);
}
[Fact]
public void ProcessRequest__OneQueryParameterGet__FormData()
{
FakeWebContext fakeWebContext = new();
fakeWebContext.RequestQuery.Add("Test", "Value");
FrmEcho frmEcho = new();
frmEcho.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(
expected: """
expected: """
<pre><code>
Header:{ }
Query:{ "Test": "Value" }
@@ -48,20 +48,20 @@ public class FrmEchoTests
""",
actual: result);
}
[Fact]
public void ProcessRequest__OneFormParameterPost__FormData()
{
FakeWebContext fakeWebContext = new(requestMethod: "POST");
fakeWebContext.RequestForm.Add("Test", "Value");
FrmEcho frmEcho = new();
frmEcho.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(
expected: """
expected: """
<pre><code>
Header:{ }
Query:{ }

View File

@@ -11,13 +11,13 @@ public class FrmErrorTests
{
FakeWebContext fakeWebContext = new();
FrmError frmError = new(new Exception("Test"));
frmError.ProcessRequest(fakeWebContext);
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
string result = fakeWebContext.FakeWritePackages.ToString("");
Assert.Equal(
expected: """
expected: """
<!DOCTYPE html>
<html ><head ><title>Application Error</title><meta content="IE=Edge" http-equiv="X-UA-Compatible" /><meta content="text/html; charset=utf-8" http-equiv="content-type" /><meta name="author" /><meta name="Copyright" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=4, user-scalable=1" /><script type="text/javascript" src="ScriptsBundler?v=1.0.0.0"></script>
<link href="StylesBundler?v=1.0.0.0" type="text/css" rel="stylesheet"/>
@@ -25,5 +25,4 @@ public class FrmErrorTests
""",
actual: result);
}
}

View File

@@ -11,10 +11,7 @@ public class PageCommonTests
private class TestEmptyForm : PageCommon
{
public TestEmptyForm(bool mustBeAuthenticated)
{
MustBeAuthenticated = mustBeAuthenticated;
}
public TestEmptyForm(bool mustBeAuthenticated) { MustBeAuthenticated = mustBeAuthenticated; }
}
[Fact]

View File

@@ -75,10 +75,7 @@ public class PageTests
Page page = new();
page.Load += (_, _) =>
{
if (page.IsPostBack)
{
fakeWebContext.FakeSetResponseHasStarted(true);
}
if (page.IsPostBack) { fakeWebContext.FakeSetResponseHasStarted(true); }
};
page.ProcessRequest(fakeWebContext);
@@ -96,10 +93,7 @@ public class PageTests
Page page = new();
page.Load += (_, _) =>
{
if (page.IsPostBack)
{
fakeWebContext.FakeSetResponseHasStarted(true);
}
if (page.IsPostBack) { fakeWebContext.FakeSetResponseHasStarted(true); }
};
page.ProcessRequest(fakeWebContext);

View File

@@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
@@ -22,7 +22,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj" />
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj"/>
</ItemGroup>
</Project>