Commit 23409b3e 23409b3e25089eb5ddb331e9f86c7412e04b0775 by Christian Gerdes

Merge with master (solved conflicts)

2 parents eb1b7ec9 c6aec8c3
......@@ -13,6 +13,10 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -1499,6 +1503,7 @@
<Compile Include="BouncyCastle_src\x509\X509V2AttributeCertificateGenerator.cs" />
<Compile Include="BouncyCastle_src\x509\X509V2CRLGenerator.cs" />
<Compile Include="BouncyCastle_src\x509\X509V3CertificateGenerator.cs" />
<Compile Include="Skv.cs" />
<Compile Include="ValidationRules.cs" />
<Compile Include="ExtractionRules.cs" />
<Compile Include="Beta.cs" />
......
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}
/* Skatteverkets plugins
(C) Skatteverket Svenska STATEN!!!
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.WebTesting;
using System.ComponentModel;
namespace LIL_VSTT_Plugins
{
[DisplayName("Validera Header")]
[Description("(C) Mårten\r\nValiderar att en header har ett visst värde i svaret.")]
public class ValidateHeader : ValidationRule
{
[DisplayName("Header Namn"), DefaultValue(""), Description("Namnet på headern i svaret")]
public string HeaderName { get; set; }
[DisplayName("Värde"), DefaultValue(""), Description("Värdet som headern ska ha")]
public string HeaderValue { get; set; }
public override void Validate(object sender, ValidationEventArgs e)
{
e.IsValid = false;
e.Message = "Default triggades. False! Check the code!!";
if (e.Response.Headers[HeaderName] == HeaderValue)
{
e.IsValid = true;
e.Message = "Hittade header " + HeaderName + " med värde " + HeaderValue;
} else
{
e.IsValid = false;
e.Message = "Hittande ingen header med namnet " + HeaderName + " och värdet " + HeaderValue;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="WebTest8" Id="bac430ba-6ffc-4989-a29b-d9425412a248" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="GET" Guid="98c3ac11-a7d8-4267-ad44-075ad706a99b" Version="1.1" Url="http://na28133.rsva.se:8080/SiteScope/servlet/Main" ThinkTime="1" Timeout="300" ParseDependentRequests="False" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
<Request Method="GET" Guid="98c3ac11-a7d8-4267-ad44-075ad706a99b" Version="1.1" Url="http://www.skatteverket.se/" ThinkTime="1" Timeout="300" ParseDependentRequests="False" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<ValidationRules>
<ValidationRule Classname="LIL_VSTT_Plugins.ValidateHeader, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Validera Header" Description="(C) Mårten&#xD;&#xA;Validerar att en header har ett visst värde i svaret." Level="High" ExectuionOrder="BeforeDependents">
<RuleParameters>
<RuleParameter Name="HeaderName" Value="Server" />
<RuleParameter Name="HeaderValue" Value="Apache-Coyote/1.1" />
</RuleParameters>
</ValidationRule>
</ValidationRules>
</Request>
</Items>
</WebTest>
\ No newline at end of file
......