crashTest
Tony Fages 2 years ago
parent 75b3a04567
commit aa489ca840

@ -1,111 +1,120 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup> <SSDTUnitTestPath Condition="'$(SSDTUnitTestPath)' == ''">$(VsInstallRoot)\Common7\IDE\Extensions\Microsoft\SQLDB</SSDTUnitTestPath>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks> </PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks> <PropertyGroup>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> <SSDTPath Condition="'$(SSDTPath)' == ''">$(VsInstallRoot)\Common7\IDE\Extensions\Microsoft\SQLDB\DAC</SSDTPath>
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> --> </PropertyGroup>
<!--<RuntimeIdentifiers>maccatalyst-arm64</RuntimeIdentifiers>--> <PropertyGroup>
<OutputType>Exe</OutputType> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<RootNamespace>ParionsCuite</RootNamespace> </PropertyGroup>
<UseMaui>true</UseMaui> <PropertyGroup>
<SingleProject>true</SingleProject> <TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- Display name --> <!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<ApplicationTitle>ParionsCuite</ApplicationTitle> <!--<RuntimeIdentifiers>maccatalyst-arm64</RuntimeIdentifiers>-->
<OutputType>Exe</OutputType>
<!-- App Identifier --> <RootNamespace>ParionsCuite</RootNamespace>
<ApplicationId>com.companyname.parionscuite</ApplicationId> <UseMaui>true</UseMaui>
<ApplicationIdGuid>be941c7a-90b1-469a-aa20-94c786120159</ApplicationIdGuid> <SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Versions --> <!-- Display name -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> <ApplicationTitle>ParionsCuite</ApplicationTitle>
<ApplicationVersion>1</ApplicationVersion> <!-- App Identifier -->
<ApplicationId>com.companyname.parionscuite</ApplicationId>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion> <ApplicationIdGuid>be941c7a-90b1-469a-aa20-94c786120159</ApplicationIdGuid>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion> <!-- Versions -->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion> <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion> <ApplicationVersion>1</ApplicationVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
</PropertyGroup> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'"> <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<CreatePackage>false</CreatePackage> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage> <CreatePackage>false</CreatePackage>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'">
<!-- App Icon --> <CreatePackage>false</CreatePackage>
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" /> </PropertyGroup>
<ItemGroup>
<!-- Splash Screen --> <!-- App Icon -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" /> <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<!-- Images --> <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<MauiImage Include="Resources\Images\*" /> <!-- Images -->
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /> <MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts --> <!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" /> <MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<!-- Raw Assets (also remove the "Resources\Raw" prefix) --> <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<Compile Remove="Test\**" /> </ItemGroup>
<EmbeddedResource Remove="Test\**" /> <ItemGroup>
<MauiCss Remove="Test\**" /> <MauiXaml Update="Views\Accueil.xaml">
<MauiXaml Remove="Test\**" /> <Generator>MSBuild:Compile</Generator>
<None Remove="Test\**" /> </MauiXaml>
</ItemGroup> <MauiXaml Update="Views\Groupe.xaml">
<Generator>MSBuild:Compile</Generator>
<ItemGroup> </MauiXaml>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" /> <MauiXaml Update="Views\Information\Info.xaml">
</ItemGroup> <Generator>MSBuild:Compile</Generator>
</MauiXaml>
<ItemGroup> <MauiXaml Update="Views\Invite\Inviter.xaml">
<MauiXaml Update="Views\Accueil.xaml"> <Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator> </MauiXaml>
</MauiXaml> <MauiXaml Update="Views\Pari\Parier.xaml">
<MauiXaml Update="Views\Groupe.xaml"> <Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator> </MauiXaml>
</MauiXaml> </ItemGroup>
<MauiXaml Update="Views\Information\Info.xaml"> <ItemGroup>
<Generator>MSBuild:Compile</Generator> <None Remove="Resources\Images\fleches.png" />
</MauiXaml> <None Remove="Views\Ajout_Paris\" />
<MauiXaml Update="Views\Invite\Inviter.xaml"> <None Remove="Views\Participations\" />
<Generator>MSBuild:Compile</Generator> <None Remove="Views\Participations\Autre\" />
</MauiXaml> <None Remove="Views\Participations\Boisson\" />
<MauiXaml Update="Views\Pari\Parier.xaml"> <None Remove="Modeles\" />
<Generator>MSBuild:Compile</Generator> <None Remove="Stub\" />
</MauiXaml> <None Remove="Test\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ItemGroup> <BundleResource Include="Resources\Images\fleches.png" />
<None Remove="Resources\Images\fleches.png" /> </ItemGroup>
<None Remove="Views\Ajout_Paris\" /> <ItemGroup>
<None Remove="Views\Participations\" /> <EmbeddedResource Include="Resources\Images\fleches.png" />
<None Remove="Views\Participations\Autre\" /> </ItemGroup>
<None Remove="Views\Participations\Boisson\" /> <ItemGroup>
<None Remove="Modeles\" /> <Folder Include="Views\Ajout_Paris\" />
<None Remove="Stub\" /> <Folder Include="Views\Participations\" />
<None Remove="Test\" /> <Folder Include="Views\Participations\Autre\" />
</ItemGroup> <Folder Include="Views\Participations\Boisson\" />
<ItemGroup> <Folder Include="Modeles\" />
<BundleResource Include="Resources\Images\fleches.png" /> <Folder Include="Stub\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<EmbeddedResource Include="Resources\Images\fleches.png" /> <ItemGroup Condition="$(VisualStudioVersion) == '17.0'">
</ItemGroup> <Reference Include="Microsoft.Data.Tools.Schema.Sql, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<ItemGroup> <HintPath>$(SSDTPath)\Microsoft.Data.Tools.Schema.Sql.dll</HintPath>
<Folder Include="Views\Ajout_Paris\" /> <Private>True</Private>
<Folder Include="Views\Participations\" /> </Reference>
<Folder Include="Views\Participations\Autre\" /> <Reference Include="Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Folder Include="Views\Participations\Boisson\" /> <HintPath>$(SSDTUnitTestPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll</HintPath>
<Folder Include="Modeles\" /> <Private>True</Private>
<Folder Include="Stub\" /> </Reference>
</ItemGroup> <Reference Include="Microsoft.Data.Tools.Schema.Sql.UnitTestingAdapter, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>$(SSDTUnitTestPath)\Microsoft.Data.Tools.Schema.Sql.UnitTestingAdapter.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<PropertyGroup>
<SsdtUnitTestVersion>3.1</SsdtUnitTestVersion>
</PropertyGroup>
<Import Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="$(VisualStudioVersion) != '15.0' And '$(SQLDBExtensionsRefPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="$(VisualStudioVersion) != '15.0' And '$(SQLDBExtensionsRefPath)' == ''" />
</Project> </Project>

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Common;
using Microsoft.Data.Tools.Schema.Sql.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ParionsCuite.Test
{
[TestClass()]
public class SqlDatabaseSetup
{
[AssemblyInitialize()]
public static void InitializeAssembly(TestContext ctx)
{
// Setup the test database based on setting in the
// configuration file
SqlDatabaseTestClass.TestService.DeployDatabaseProject();
SqlDatabaseTestClass.TestService.GenerateData();
}
}
}

@ -0,0 +1,6 @@
namespace ParionsCuite.Test
{
internal class TestInitializeAttribute : Attribute
{
}
}

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
using Microsoft.Data.Tools.Schema.Sql.UnitTesting;
using Microsoft.Data.Tools.Schema.Sql.UnitTesting.Conditions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ParionsCuite.Test
{
[TestClass()]
public class TestManager : SqlDatabaseTestClass
{
public TestManager()
{
InitializeComponent();
}
[TestInitialize()]
public void TestInitialize()
{
base.InitializeTest();
}
[TestCleanup()]
public void TestCleanup()
{
base.CleanupTest();
}
[TestMethod()]
public void SqlTest1()
{
SqlDatabaseTestActions testActions = this.SqlTest1Data;
// Execute the pre-test script
//
System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
SqlExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
// Execute the test script
//
System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
SqlExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
// Execute the post-test script
//
System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
SqlExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
}
#region Designer support code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SqlTest1Data = new SqlDatabaseTestActions();
//
// SqlTest1Data
//
this.SqlTest1Data.PosttestAction = null;
this.SqlTest1Data.PretestAction = null;
this.SqlTest1Data.TestAction = null;
}
#endregion
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
#endregion
private SqlDatabaseTestActions SqlTest1Data;
}
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.data>
<DbProviderFactories>
<add name="Microsoft SqlClient Data Provider"
invariant="Microsoft.Data.SqlClient"
description="Microsoft SqlClient Data Provider for SqlServer"
type="Microsoft.Data.SqlClient.SqlClientFactory, Microsoft.Data.SqlClient" />
</DbProviderFactories>
</system.data>
</configuration>
Loading…
Cancel
Save