Skip to content

Commit

Permalink
Merge pull request #635 from Jevonius/conditional/NUNIT
Browse files Browse the repository at this point in the history
NUNIT_SETCULTUREATTRIBUTE and NUNIT_TIMEOUTATTRIBUTE (Remove)
  • Loading branch information
jonorossi authored Dec 1, 2022
2 parents 1c4cc01 + 1263d4a commit f64367f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,3 @@ The following conditional compilation symbols are defined for tests only under .
* `FEATURE_CONSOLETRACELISTENER` - enables code that requires `System.Diagnostics.ConsoleTraceListener`.
* `FEATURE_THREADABORT` - enables code that uses `Thread.Abort()`.
* `FEATURE_WPF` - enables code that uses `PresentationCore.dll`.
* `NUNIT_SETCULTUREATTRIBUTE` - uses `NUnit.Framework.SetCultureAttribute`.
* `NUNIT_TIMEOUTATTRIBUTE` - uses `NUnit.Framework.TimeoutAttribute`.
2 changes: 1 addition & 1 deletion src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
<DefineConstants>$(DefineConstants);NUNIT_SETCULTUREATTRIBUTE;NUNIT_TIMEOUTATTRIBUTE;FEATURE_THREADABORT;FEATURE_WPF;FEATURE_CONSOLETRACELISTENER</DefineConstants>
<DefineConstants>$(DefineConstants);FEATURE_THREADABORT;FEATURE_WPF;FEATURE_CONSOLETRACELISTENER</DefineConstants>
</PropertyGroup>

</Project>
9 changes: 3 additions & 6 deletions src/Castle.Windsor.Tests/DefaultConversionManagerTestCase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/
// Copyright 2004-2022 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,20 +29,17 @@ public class DefaultConversionManagerTestCase
{
private readonly DefaultConversionManager converter = new DefaultConversionManager();

#if NUNIT_SETCULTUREATTRIBUTE
// currently not supported by SL
[Test]
[SetCulture("pl-PL")]
[Bug("IOC-314")]
public void Converting_numbers_uses_oridinal_culture()
public void Converting_numbers_uses_ordinal_culture()
{
Assert.AreEqual(",", Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);

var result = converter.PerformConversion<Decimal>("123.456");
var result = converter.PerformConversion<decimal>("123.456");

Assert.AreEqual(123.456m, result);
}
#endif

[Test]
public void PerformConversionInt()
Expand Down
4 changes: 1 addition & 3 deletions src/Castle.Windsor.Tests/LazyLoadingTestCase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2004-2011 Castle Project - http://www.castleproject.org/
// Copyright 2004-2022 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,6 @@ public void Component_loaded_lazily_can_have_lazy_dependencies()
Container.Resolve<B>();
}

#if NUNIT_TIMEOUTATTRIBUTE
[Test]
[Timeout(2000)]
public void Loaders_are_thread_safe()
Expand Down Expand Up @@ -98,7 +97,6 @@ public void Loaders_are_thread_safe()
Assert.IsNull(exception);
Assert.AreEqual(0, count[0]);
}
#endif

[Test]
public void Loaders_only_triggered_when_resolving()
Expand Down

0 comments on commit f64367f

Please sign in to comment.