diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-27 16:49:42 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-27 16:49:42 +0200 |
| commit | 2ab54573d10ca59351100ab8416178be2223fc91 (patch) | |
| tree | 9a5077998e301c1e86cf00b07ea98eca501fc4a8 /Software/Visual_Studio/Tango.UnitTesting | |
| parent | 88a73106e8113a4a6ce224f9205e11219939798e (diff) | |
| download | Tango-2ab54573d10ca59351100ab8416178be2223fc91.tar.gz Tango-2ab54573d10ca59351100ab8416178be2223fc91.zip | |
Added support for caching on machine studio.
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
4 files changed, 97 insertions, 31 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/App.config b/Software/Visual_Studio/Tango.UnitTesting/App.config index 1a3af14d9..074da9ac0 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/App.config +++ b/Software/Visual_Studio/Tango.UnitTesting/App.config @@ -4,6 +4,24 @@ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections> + <appSettings> + <add key="DB_ADDRESS" value="twine.database.windows.net" /> + <add key="DB_USER_NAME" value="Roy" /> + <add key="DB_PASSWORD" value="Aa123456" /> + <add key="DB_CATALOG" value="Tango_DEV" /> + <add key="STORAGE_ACCOUNT" value="DefaultEndpointsProtocol=https;AccountName=tangostorage;AccountKey=S4z/D+Yg6mwMis+bs/VpcDLA9yE1iZaYq23shQlRIi2KmM9E7JY8zdZjeAPOPdG3gONHoNDEpsgH6D4cqQ/bsA==;EndpointSuffix=core.windows.net" /> + <add key="TENANT_ID" value="2ebd63a5-bc2f-41dc-9066-4409ed5e5dd4" /> + <add key="CLIENT_ID" value="ec612854-7abc-457b-808a-5d0c5ba80c57" /> + <add key="APP_SECRET" value="54)019A7wv+#86l*PQcQWYKu%fd4Dv!@G=VhCiDI5rD+H4BTH" /> + <add key="TANGO_VERSIONS_CONTAINER" value="tango-versions-dev" /> + <add key="MACHINE_STUDIO_VERSIONS_CONTAINER" value="machine-studio-versions-dev" /> + <add key="DEPLOYMENT_SLOT" value="DEV" /> + <add key="ENVIRONMENT_GROUP" value="Tango DEV" /> + <add key="ENFORCE_MACHINE_STUDIO_VERSION" value="true" /> + <add key="JWT_TOKEN_SECRET" value="GQDstcKsx0NHjLOuXOYg5MbeJ1yT0u1iwDVTwine" /> + <add key="REFRESH_TOKENS_TABLE_NAME" value="RefreshTokens" /> + <add key="REFRESH_TOKENS_TABLE_PARTITION" value="REFRESH_TOKENS_PART" /> + </appSettings> <entityFramework> <providers> <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /> @@ -14,9 +32,26 @@ </entityFramework> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> - <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> @@ -59,32 +94,8 @@ <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs index 21ab16307..d4585388a 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs @@ -5,6 +5,7 @@ using Tango.BL; using Tango.MachineStudio.Common.Web; using Tango.Transport.Web; using System.Linq; +using System.Configuration; namespace Tango.UnitTesting.MachineService { @@ -74,5 +75,34 @@ namespace Tango.UnitTesting.MachineService Assert.IsFalse(res5.IsUpdateAvailable); } + + [TestMethod] + public void Login_with_new_user() + { + //LoadConfiguration(); + + Tango.MachineService.Controllers.MachineStudioController controller = new Tango.MachineService.Controllers.MachineStudioController(); + + + + controller.Login(new LoginRequest() + { + Email = "Mati@twine-s.com", + Password = "Futo8985", + }); + } + + //private void LoadConfiguration() + //{ + // ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap(); + // fileMap.ExeConfigFilename = @"web.config"; + + // Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); + + // foreach (var item in config.AppSettings.Settings.OfType<KeyValueConfigurationElement>()) + // { + // ConfigurationManager.AppSettings.Add(item.Key, item.Value); + // } + //} } } diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 4e852fed8..d1bba995e 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -25,7 +25,7 @@ <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> - <OutputPath>..\Build\Core\Debug\</OutputPath> + <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>0</WarningLevel> @@ -35,7 +35,7 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> - <OutputPath>..\Build\Core\Release\</OutputPath> + <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> @@ -60,6 +60,16 @@ <HintPath>..\packages\JWT.5.0.0\lib\net46\JWT.dll</HintPath> </Reference> <Reference Include="Microsoft.CSharp" /> + <Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.13.5.907, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.7.10707.1513-rc\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.13.5.907, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.13.5\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms"> + <HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.7.10707.1513-rc\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath> + </Reference> <Reference Include="Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL"> <EmbedInteropTypes>True</EmbedInteropTypes> </Reference> @@ -76,6 +86,7 @@ </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> <Reference Include="System.Data" /> <Reference Include="System.Data.Entity.Design" /> @@ -91,6 +102,13 @@ <HintPath>..\packages\System.Data.SQLite.Linq.1.0.108.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath> <Private>True</Private> </Reference> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath> + </Reference> + <Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath> + </Reference> <Reference Include="TestStack.White, Version=0.13.0.0, Culture=neutral, PublicKeyToken=2672efbf3e161801, processorArchitecture=MSIL"> <HintPath>..\packages\TestStack.White.0.13.3\lib\net40\TestStack.White.dll</HintPath> </Reference> @@ -216,6 +234,10 @@ <Project>{ebb7cb9f-6af2-456b-a5dd-1b136b605d90}</Project> <Name>Tango.DBObservablesGenerator.CLI</Name> </ProjectReference> + <ProjectReference Include="..\Web\Tango.MachineService\Tango.MachineService.csproj"> + <Project>{3f09b230-5aac-4651-ba7a-19f3bdfcf701}</Project> + <Name>Tango.MachineService</Name> + </ProjectReference> </ItemGroup> <ItemGroup> <Content Include="AdvancedInstaller\DemoProject\Files\File3.txt"> @@ -242,7 +264,7 @@ <Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/packages.config b/Software/Visual_Studio/Tango.UnitTesting/packages.config index 0528c7ef0..e3fc2d3b6 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/packages.config +++ b/Software/Visual_Studio/Tango.UnitTesting/packages.config @@ -5,6 +5,9 @@ <package id="EntityFramework" version="6.2.0" targetFramework="net461" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> <package id="JWT" version="5.0.0" targetFramework="net461" /> + <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net461" /> + <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net461" /> + <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" /> <package id="MSTest.TestAdapter" version="1.1.11" targetFramework="net45" /> <package id="MSTest.TestFramework" version="1.1.11" targetFramework="net45" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" /> |
