Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
linphone-windows10
Commits
2db649a6
Commit
2db649a6
authored
Jan 21, 2016
by
Ghislain MARY
Browse files
Add tester projects.
parent
b6eb5094
Changes
54
Hide whitespace changes
Inline
Side-by-side
testers/BelleSipTester/App.xaml
0 → 100644
View file @
2db649a6
<Application
x:Class="BelleSipTester.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BelleSipTester"
xmlns:model="using:belle_sip_tester.DataModel"
RequestedTheme="Light">
<Application.Resources>
<ResourceDictionary>
<model:UnitTestCaseStateToSymbolConverter x:Key="UnitTestCaseStateToSymbol"/>
<model:UnitTestCaseStateToSymbolColorConverter x:Key="UnitTestCaseStateToSymbolColor"/>
<model:OutputTraceLevelToColorConverter x:Key="OutputTraceLevelToColor"/>
</ResourceDictionary>
</Application.Resources>
</Application>
testers/BelleSipTester/App.xaml.cs
0 → 100644
View file @
2db649a6
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Runtime.InteropServices.WindowsRuntime
;
using
Windows.ApplicationModel
;
using
Windows.ApplicationModel.Activation
;
using
Windows.Foundation
;
using
Windows.Foundation.Collections
;
using
Windows.UI.Xaml
;
using
Windows.UI.Xaml.Controls
;
using
Windows.UI.Xaml.Controls.Primitives
;
using
Windows.UI.Xaml.Data
;
using
Windows.UI.Xaml.Input
;
using
Windows.UI.Xaml.Media
;
using
Windows.UI.Xaml.Navigation
;
namespace
BelleSipTester
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed
partial
class
App
:
Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public
App
()
{
this
.
InitializeComponent
();
this
.
Suspending
+=
OnSuspending
;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected
override
void
OnLaunched
(
LaunchActivatedEventArgs
e
)
{
#if DEBUG
if
(
System
.
Diagnostics
.
Debugger
.
IsAttached
)
{
this
.
DebugSettings
.
EnableFrameRateCounter
=
true
;
}
#endif
Frame
rootFrame
=
Window
.
Current
.
Content
as
Frame
;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if
(
rootFrame
==
null
)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame
=
new
Frame
();
rootFrame
.
NavigationFailed
+=
OnNavigationFailed
;
if
(
e
.
PreviousExecutionState
==
ApplicationExecutionState
.
Terminated
)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window
.
Current
.
Content
=
rootFrame
;
}
if
(
rootFrame
.
Content
==
null
)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame
.
Navigate
(
typeof
(
MainPage
),
e
.
Arguments
);
}
// Ensure the current window is active
Window
.
Current
.
Activate
();
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void
OnNavigationFailed
(
object
sender
,
NavigationFailedEventArgs
e
)
{
throw
new
Exception
(
"Failed to load Page "
+
e
.
SourcePageType
.
FullName
);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private
void
OnSuspending
(
object
sender
,
SuspendingEventArgs
e
)
{
var
deferral
=
e
.
SuspendingOperation
.
GetDeferral
();
//TODO: Save application state and stop any background activity
deferral
.
Complete
();
}
protected
override
void
OnActivated
(
IActivatedEventArgs
args
)
{
if
(
args
.
Kind
==
ActivationKind
.
Protocol
)
{
var
protocolArgs
=
(
ProtocolActivatedEventArgs
)
args
;
var
uri
=
protocolArgs
.
Uri
;
Frame
rootFrame
=
Window
.
Current
.
Content
as
Frame
;
if
(
rootFrame
==
null
)
rootFrame
=
new
Frame
();
rootFrame
.
NavigationFailed
+=
OnNavigationFailed
;
rootFrame
.
Navigate
(
typeof
(
MainPage
),
uri
);
Window
.
Current
.
Content
=
rootFrame
;
Window
.
Current
.
Activate
();
}
base
.
OnActivated
(
args
);
}
}
}
testers/BelleSipTester/Assets/Logo.png
0 → 100644
View file @
2db649a6
11.5 KB
testers/BelleSipTester/Assets/SmallLogo.png
0 → 100644
View file @
2db649a6
2.11 KB
testers/BelleSipTester/Assets/SplashScreen.png
0 → 100644
View file @
2db649a6
29.2 KB
testers/BelleSipTester/Assets/StoreLogo.png
0 → 100644
View file @
2db649a6
2.62 KB
testers/BelleSipTester/Assets/WideLogo.png
0 → 100644
View file @
2db649a6
21 KB
testers/BelleSipTester/Assets/rootca.pem
0 → 100644
View file @
2db649a6
This source diff could not be displayed because it is too large. You can
view the blob
instead.
testers/BelleSipTester/BelleSipTester.csproj
0 → 100644
View file @
2db649a6
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
x86
</Platform>
<ProjectGuid>
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}
</ProjectGuid>
<OutputType>
AppContainerExe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
BelleSipTester
</RootNamespace>
<AssemblyName>
BelleSipTester
</AssemblyName>
<DefaultLanguage>
en-US
</DefaultLanguage>
<TargetPlatformIdentifier>
UAP
</TargetPlatformIdentifier>
<TargetPlatformVersion>
10.0.10586.0
</TargetPlatformVersion>
<TargetPlatformMinVersion>
10.0.10240.0
</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>
14
</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>
true
</EnableDotNetNativeCompatibleProfile>
<FileAlignment>
512
</FileAlignment>
<ProjectTypeGuids>
{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
<PackageCertificateKeyFile>
BelleSipTester_TemporaryKey.pfx
</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|ARM'"
>
<DebugSymbols>
true
</DebugSymbols>
<OutputPath>
bin\ARM\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
</DefineConstants>
<NoWarn>
;2008
</NoWarn>
<DebugType>
full
</DebugType>
<PlatformTarget>
ARM
</PlatformTarget>
<UseVSHostingProcess>
false
</UseVSHostingProcess>
<ErrorReport>
prompt
</ErrorReport>
<Prefer32Bit>
true
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|ARM'"
>
<OutputPath>
bin\ARM\Release\
</OutputPath>
<DefineConstants>
TRACE;NETFX_CORE;WINDOWS_UWP
</DefineConstants>
<Optimize>
true
</Optimize>
<NoWarn>
;2008
</NoWarn>
<DebugType>
pdbonly
</DebugType>
<PlatformTarget>
ARM
</PlatformTarget>
<UseVSHostingProcess>
false
</UseVSHostingProcess>
<ErrorReport>
prompt
</ErrorReport>
<Prefer32Bit>
true
</Prefer32Bit>
<UseDotNetNativeToolchain>
true
</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|x64'"
>
<DebugSymbols>
true
</DebugSymbols>
<OutputPath>
bin\x64\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
</DefineConstants>
<NoWarn>
;2008
</NoWarn>
<DebugType>
full
</DebugType>
<PlatformTarget>
x64
</PlatformTarget>
<UseVSHostingProcess>
false
</UseVSHostingProcess>
<ErrorReport>
prompt
</ErrorReport>
<Prefer32Bit>
true
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|x64'"
>
<OutputPath>
bin\x64\Release\
</OutputPath>
<DefineConstants>
TRACE;NETFX_CORE;WINDOWS_UWP
</DefineConstants>
<Optimize>
true
</Optimize>
<NoWarn>
;2008
</NoWarn>
<DebugType>
pdbonly
</DebugType>
<PlatformTarget>
x64
</PlatformTarget>
<UseVSHostingProcess>
false
</UseVSHostingProcess>
<ErrorReport>
prompt
</ErrorReport>
<Prefer32Bit>
true
</Prefer32Bit>
<UseDotNetNativeToolchain>
true
</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|x86'"
>
<DebugSymbols>
true
</DebugSymbols>
<OutputPath>
bin\x86\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
</DefineConstants>
<NoWarn>
;2008
</NoWarn>
<DebugType>
full
</DebugType>
<PlatformTarget>
x86
</PlatformTarget>
<UseVSHostingProcess>
false
</UseVSHostingProcess>
<ErrorReport>
prompt
</ErrorReport>
<Prefer32Bit>
true
</Prefer32Bit>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|x86'"
>
<OutputPath>
bin\x86\Release\
</OutputPath>
<DefineConstants>
TRACE;NETFX_CORE;WINDOWS_UWP
</DefineConstants>
<Optimize>
true
</Optimize>
<NoWarn>
;2008
</NoWarn>
<DebugType>
pdbonly
</DebugType>
<PlatformTarget>
x86
</PlatformTarget>
<UseVSHostingProcess>
false
</UseVSHostingProcess>
<ErrorReport>
prompt
</ErrorReport>
<Prefer32Bit>
true
</Prefer32Bit>
<UseDotNetNativeToolchain>
true
</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<None
Include=
"project.json"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"App.xaml.cs"
>
<DependentUpon>
App.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"MainPage.xaml.cs"
>
<DependentUpon>
MainPage.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"DataModel\UnitTestDataSource.cs"
/>
</ItemGroup>
<ItemGroup>
<AppxManifest
Include=
"Package.appxmanifest"
>
<SubType>
Designer
</SubType>
</AppxManifest>
<None
Include=
"BelleSipTester_TemporaryKey.pfx"
/>
</ItemGroup>
<ItemGroup>
<Content
Include=
"Properties\Default.rd.xml"
/>
<Content
Include=
"Assets\Logo.png"
/>
<Content
Include=
"Assets\SplashScreen.png"
/>
<Content
Include=
"Assets\SmallLogo.png"
/>
<Content
Include=
"Assets\StoreLogo.png"
/>
<Content
Include=
"Assets\WideLogo.png"
/>
<Content
Include=
"Assets\rootca.pem"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition
Include=
"App.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</ApplicationDefinition>
<Page
Include=
"MainPage.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
</ItemGroup>
<PropertyGroup
Condition=
" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "
>
<VisualStudioVersion>
14.0
</VisualStudioVersion>
</PropertyGroup>
<Import
Project=
"$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.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>
\ No newline at end of file
testers/BelleSipTester/BelleSipTester.sln
0 → 100644
View file @
2db649a6
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BelleSipTester", "BelleSipTester.csproj", "{299F662A-94BD-46CC-9BBF-A802EF59FAD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|ARM.ActiveCfg = Debug|ARM
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|ARM.Build.0 = Debug|ARM
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|ARM.Deploy.0 = Debug|ARM
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|x64.ActiveCfg = Debug|x64
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|x64.Build.0 = Debug|x64
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|x64.Deploy.0 = Debug|x64
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|x86.ActiveCfg = Debug|x86
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|x86.Build.0 = Debug|x86
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Debug|x86.Deploy.0 = Debug|x86
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|ARM.ActiveCfg = Release|ARM
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|ARM.Build.0 = Release|ARM
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|ARM.Deploy.0 = Release|ARM
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|x64.ActiveCfg = Release|x64
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|x64.Build.0 = Release|x64
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|x64.Deploy.0 = Release|x64
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|x86.ActiveCfg = Release|x86
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|x86.Build.0 = Release|x86
{299F662A-94BD-46CC-9BBF-A802EF59FAD4}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
testers/BelleSipTester/BelleSipTester_TemporaryKey.pfx
0 → 100644
View file @
2db649a6
File added
testers/BelleSipTester/DataModel/UnitTestDataSource.cs
0 → 100644
View file @
2db649a6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
belle_sip_tester_runtime
;
using
System.Collections.ObjectModel
;
using
Windows.UI.Xaml
;
using
Windows.UI.Xaml.Controls
;
using
Windows.UI.Xaml.Data
;
using
Windows.UI.Xaml.Media
;
using
System.ComponentModel
;
using
Windows.UI
;
using
Windows.UI.Xaml.Documents
;
using
Windows.UI.Core
;
namespace
belle_sip_tester.DataModel
{
public
class
OutputTrace
{
public
OutputTrace
(
String
lev
,
String
msg
)
{
Level
=
lev
;
Msg
=
msg
;
}
public
String
Level
{
get
;
private
set
;
}
public
String
Msg
{
get
;
private
set
;
}
}
public
class
UnitTestSuite
{
public
UnitTestSuite
(
string
name
)
{
Name
=
name
;
Cases
=
new
ObservableCollection
<
UnitTestCase
>();
Selected
=
false
;
}
public
string
Name
{
get
;
private
set
;
}
public
bool
Selected
{
get
{
return
Cases
.
All
(
x
=>
x
.
Selected
);
}
set
{
foreach
(
UnitTestCase
c
in
Cases
)
{
c
.
Selected
=
value
;
}
}
}
public
ObservableCollection
<
UnitTestCase
>
Cases
{
get
;
private
set
;
}
}
public
enum
UnitTestCaseState
{
NotRun
,
Success
,
Failure
}
public
class
UnitTestCase
:
INotifyPropertyChanged
{
public
UnitTestCase
(
UnitTestSuite
suite
,
string
name
)
{
_suite
=
new
WeakReference
(
suite
);
Name
=
name
;
Selected
=
false
;
State
=
UnitTestCaseState
.
NotRun
;
Traces
=
new
ObservableCollection
<
OutputTrace
>();
}
public
UnitTestSuite
Suite
{
get
{
return
_suite
.
Target
as
UnitTestSuite
;
}
}
public
string
Name
{
get
;
private
set
;
}
public
bool
Selected
{
get
{
return
_selected
;
}
set
{
_selected
=
value
;
RaisePropertyChanged
(
"Selected"
);
}
}
public
UnitTestCaseState
State
{
get
{
return
_state
;
}
set
{
_state
=
value
;
RaisePropertyChanged
(
"State"
);
}
}
public
ObservableCollection
<
OutputTrace
>
Traces
{
get
{
return
_traces
;
}
set
{
_traces
=
value
;
RaisePropertyChanged
(
"Traces"
);
}
}
public
CoreDispatcher
Dispatcher
{
get
;
set
;
}
public
event
PropertyChangedEventHandler
PropertyChanged
;
protected
void
RaisePropertyChanged
(
string
name
)
{
if
(
PropertyChanged
!=
null
)
{
PropertyChanged
(
this
,
new
PropertyChangedEventArgs
(
name
));
}
}
private
WeakReference
_suite
;
private
bool
_selected
;
private
UnitTestCaseState
_state
;
private
ObservableCollection
<
OutputTrace
>
_traces
;
}
public
sealed
class
UnitTestDataSource
{
private
static
UnitTestDataSource
_unitTestDataSource
=
new
UnitTestDataSource
();
private
ObservableCollection
<
UnitTestSuite
>
_suites
=
new
ObservableCollection
<
UnitTestSuite
>();
public
ObservableCollection
<
UnitTestSuite
>
Suites
{
get
{
return
this
.
_suites
;
}
}
public
static
IEnumerable
<
UnitTestSuite
>
GetSuites
(
belle_sip_tester_runtime
.
BelleSipTester
tester
)
{
return
_unitTestDataSource
.
FillSuites
(
tester
);
}
private
IEnumerable
<
UnitTestSuite
>
FillSuites
(
belle_sip_tester_runtime
.
BelleSipTester
tester
)
{
if
(
this
.
Suites
.
Count
!=
0
)
return
this
.
Suites
;
for
(
int
i
=
0
;
i
<
tester
.
nbTestSuites
();
i
++)
{
UnitTestSuite
suite
=
new
UnitTestSuite
(
tester
.
testSuiteName
(
i
));
for
(
int
j
=
0
;
j
<
tester
.
nbTests
(
suite
.
Name
);
j
++)
{
suite
.
Cases
.
Add
(
new
UnitTestCase
(
suite
,
tester
.
testName
(
suite
.
Name
,
j
)));
}
this
.
Suites
.
Add
(
suite
);
}
return
this
.
Suites
;
}
}
public
sealed
class
UnitTestCaseStateToSymbolConverter
:
IValueConverter
{
object
IValueConverter
.
Convert
(
object
value
,
Type
targetType
,
object
parametr
,
string
language
)
{
if
(!
value
.
GetType
().
Equals
(
typeof
(
UnitTestCaseState
)))
{
throw
new
ArgumentException
(
"Only UnitTestCaseState is supported"
);
}
if
(
targetType
.
Equals
(
typeof
(
Symbol
)))
{
switch
((
UnitTestCaseState
)
value
)
{
case
UnitTestCaseState
.
Success
:
return
Symbol
.
Like
;
case
UnitTestCaseState
.
Failure
:
return
Symbol
.
Dislike
;
case
UnitTestCaseState
.
NotRun
:
default
:
return
Symbol
.
Help
;
}
}
else
{
throw
new
ArgumentException
(
string
.
Format
(
"Unsupported type {0}"
,
targetType
.
FullName
));
}
}
object
IValueConverter
.
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
throw
new
NotImplementedException
();
}
}
public
sealed
class
UnitTestCaseStateToSymbolColorConverter
:
IValueConverter
{
object
IValueConverter
.
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
if
(!
value
.
GetType
().
Equals
(
typeof
(
UnitTestCaseState
)))
{
throw
new
ArgumentException
(
"Only UnitTestCaseState is supported"
);
}
if
(
targetType
.
Equals
(
typeof
(
Brush
)))
{
switch
((
UnitTestCaseState
)
value
)
{
case
UnitTestCaseState
.
Success
:
return
new
SolidColorBrush
(
Colors
.
ForestGreen
);
case
UnitTestCaseState
.
Failure
:
return
new
SolidColorBrush
(
Colors
.
IndianRed
);
case
UnitTestCaseState
.
NotRun
:
default
:
return
new
SolidColorBrush
(
Colors
.
LightGray
);
}
}
else
{
throw
new
ArgumentException
(
string
.
Format
(
"Unsupported format {0}"
,
targetType
.
FullName
));
}
}
object
IValueConverter
.
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
throw
new
NotImplementedException
();
}
}
public
sealed
class
OutputTraceLevelToColorConverter
:
IValueConverter
{
object
IValueConverter
.
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
if
(!
value
.
GetType
().
Equals
(
typeof
(
String
)))
{
throw
new
ArgumentException
(
"Only String is supported"
);
}
if
(
targetType
.
Equals
(
typeof
(
Brush
)))
{
if
((
String
)
value
==
"Error"
)
{
return
new
SolidColorBrush
(
Colors
.
IndianRed
);
}
else
if
((
String
)
value
==
"Warning"
)
{
return
new
SolidColorBrush
(
Colors
.
Orange
);
}
return
new
SolidColorBrush
(
Colors
.
Black
);
}
else
{
throw
new
ArgumentException
(
string
.
Format
(
"Unsupported format {0}"
,
targetType
.
FullName
));
}
}
object
IValueConverter
.
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
throw
new
NotImplementedException
();
}
}
}
testers/BelleSipTester/MainPage.xaml
0 → 100644
View file @
2db649a6
<Page
x:Class="BelleSipTester.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BelleSipTester"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="using:belle_sip_tester.DataModel"