Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: migrate old tests to the new test framework #806

Merged
merged 19 commits into from Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/integration_tests.yml
Expand Up @@ -15,7 +15,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.0.0'
- name: Test
env:
INTEGRATION_TESTING_CONFIG: ${{ secrets.INTEGRATION_TESTING_CONFIG }}
run: dotnet test .\Box.V2.Test.IntegrationNew -f netcoreapp2.0
run: dotnet test .\Box.V2.Test.Integration -f netcoreapp2.0
153 changes: 28 additions & 125 deletions Box.V2.Test.Integration/Box.V2.Test.Integration.csproj
@@ -1,133 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BC6D323A-09D0-4477-B695-7F6F6B32401F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Box.V2.Test.Integration</RootNamespace>
<AssemblyName>Box.V2.Test.Integration</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<TargetFrameworks>netcoreapp2.0;net45</TargetFrameworks>

<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<Compile Include="BoxCollaborationWhitelistManagerTestIntegration.cs" />
<Compile Include="BoxCollectionsManagerTestIntegration.cs" />
<Compile Include="BoxDevicePinManagerTestIntegration.cs" />
<Compile Include="BoxEventsManagerTestIntegration.cs" />
<Compile Include="BoxFilesManagerTestIntegration.cs" />
<Compile Include="BoxFoldersManagerTestIntegration.cs" />
<Compile Include="BoxLegalHoldPoliciesManagerTestIntegration.cs" />
<Compile Include="BoxStoragePoliciesManagerTestIntegration.cs" />
<Compile Include="BoxTasksManagerTestIntegration.cs" />
<Compile Include="BoxMetadataManagerTestIntegration.cs" />
<Compile Include="BoxResourceManagerTestIntegration.cs" />
<Compile Include="BoxCommentsManagerTestIntegration.cs" />
<Compile Include="BoxSearchManagerTestIntegration.cs" />
<Compile Include="BoxSharedItemsManagerTestIntegration.cs" />
<Compile Include="BoxTermsOfServicesManagerTestIntegration.cs" />
<Compile Include="BoxUsersManagerTestIntegration.cs" />
<Compile Include="BoxCollaborationsManagerTestIntegration.cs" />
<Compile Include="BoxAuthTestIntegration.cs" />
<Compile Include="BoxRetentionPoliciesManagerTestIntegration.cs" />
<Compile Include="BoxRecentItemsManagerTestIntegration.cs" />
<Compile Include="BoxWebhooksManagerTestIntegration.cs" />
<Compile Include="BoxTokenExchangeTestIntegration.cs" />
<Compile Include="BoxWebLinkManagerTestIntegration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="BoxGroupsManagerTestIntegration.cs" />
<Compile Include="Properties\smalltestpdf.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>smalltestpdf.resx</DependentUpon>
</Compile>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Box.V2\Box.V2.csproj">
<Project>{602ff1b8-df8b-4cff-88c6-8b34468c45ad}</Project>
<Name>Box.V2</Name>
</ProjectReference>

<ItemGroup Condition="$(TargetFramework.StartsWith('netcoreapp2.0'))">
<ProjectReference Include="..\Box.V2.Core\Box.V2.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="TestData\smalltest.pdf" />
<ItemGroup Condition="$(TargetFramework.StartsWith('net45'))">
<ProjectReference Include="..\Box.V2\Box.V2.csproj" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Properties\smalltestpdf.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>smalltestpdf.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Update="config.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\smalltest.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\smalltestV2.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
28 changes: 0 additions & 28 deletions Box.V2.Test.Integration/BoxAuthTestIntegration.cs

This file was deleted.

@@ -0,0 +1,22 @@
using System.Linq;
using System.Threading.Tasks;
using Box.V2.Test.Integration.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Box.V2.Test.Integration
{
[TestClass]
public class BoxCollaborationWhitelistManagerIntegrationTest : TestInFolder
{
[TestMethod]
public async Task GetAllCollaborationWhitelistExemptUsersAsync_ForExistingCollaborator_ShouldReturnWhitelistCollaborator()
{
var user = await CreateEnterpriseUser();
var collaborationExempt = await AddCollaborationExempt(user.Id);

var allUserWhitelistItems = await AdminClient.CollaborationWhitelistManager.GetAllCollaborationWhitelistExemptUsersAsync(10);

Assert.IsTrue(allUserWhitelistItems.Entries.Any(x => x.Id == collaborationExempt.Id));
}
}
}

This file was deleted.