Skip to content

Commit

Permalink
Merge pull request #290 from Sergio0694/user/sergiopedri/remove-embed…
Browse files Browse the repository at this point in the history
…ded-source

Switch all files to file-scoped namespaces
  • Loading branch information
Sergio0694 authored Nov 21, 2024
2 parents 912c928 + 558e7d1 commit b304080
Show file tree
Hide file tree
Showing 46 changed files with 3,721 additions and 3,736 deletions.
4 changes: 0 additions & 4 deletions scripts/Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@

<file target="lib\net8.0-windows10.0.19041.0\Design\Microsoft.Xaml.Interactivity.DesignTools.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.dll" />
<file target="lib\net8.0-windows10.0.19041.0\Design\Microsoft.Xaml.Interactivity.DesignTools.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.pdb" />

<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity\**\*.cs" />
<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Design" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Design\**\*.cs" />
<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.DesignTools" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.DesignTools\**\*.cs" />
</files>

</package>
8 changes: 0 additions & 8 deletions scripts/Microsoft.Xaml.Behaviors.WinUI.Managed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@

<file target="lib\net8.0-windows10.0.17763.0\Design\Microsoft.Xaml.Interactivity.DesignTools.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.dll" />
<file target="lib\net8.0-windows10.0.17763.0\Design\Microsoft.Xaml.Interactivity.DesignTools.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.pdb" />

<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.WinUI" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Shared\**\*.cs" />

<!--
<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Design" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Design\**\*.cs" />
-->

<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.DesignTools" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.DesignTools\**\*.cs" />
</files>

</package>
37 changes: 37 additions & 0 deletions src/BehaviorsSDKManaged/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project>

<!--
Set the $(SolutionDir) property if needed. This is referenced in other projects as well.
This property is only set automatically by MSBuild when building from the IDE. For more info, see:
https://docs.microsoft.com/en-us/cpp/build/reference/common-macros-for-build-commands-and-properties#list-of-common-macros.
To work around this and enable individual projects to build correctly, it is defined manually if needed.
That is, if empty, the solution path is computed by moving upwards until the solution file is found.
-->
<PropertyGroup Label="Globals">
<BehaviorsSDKManagedSolutionPath>$([MSBuild]::EnsureTrailingSlash($([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), BehaviorsSDKManaged.sln))))</BehaviorsSDKManagedSolutionPath>
<SolutionDir Condition="'$(SolutionDir)' == ''">$(BehaviorsSDKManagedSolutionPath)</SolutionDir>
</PropertyGroup>

<!-- Set the C# version and other common properties -->
<PropertyGroup Condition="$(MSBuildProjectFile.EndsWith('.csproj'))">
<LangVersion>12.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!--
Enable the compiler strict mode (see https://www.meziantou.net/csharp-compiler-strict-mode.htm).
This (poorly documented) mode enables additional warnings for incorrect usages of some features.
For instance, this will warn when using the == operator to compare a struct with a null literal.
-->
<Features>strict</Features>

<!--
Generate documentation files. In theory this should only be abled for published, non source generator projects.
However, this is always enabled to work around https://github.com/dotnet/roslyn/issues/41640. Until that's fixed,
source generators will also produce an .xml file with their documentation. Note that this doesn't really impact
NuGet packages, since the analyzer binaries are packed manually after build, so the .xml files aren't included.
When this workaround is no longer needed, the same property should also removed for the \samples directory.
Once that issue is fixed, this should be moved down to the src\ specific .props file again, and otherwise disabled.
-->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
</Project>
75 changes: 37 additions & 38 deletions src/BehaviorsSDKManaged/ManagedUnitTests/ActionCollectionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,44 @@
using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
using Microsoft.Xaml.Interactivity;

namespace ManagedUnitTests
namespace ManagedUnitTests;

[TestClass]
public class ActionCollectionTest
{
[TestClass]
public class ActionCollectionTest
[UITestMethod]
public void Constructor_DefaultConstructor_SetsVolumeCorrectly()
{
PlaySoundAction playSoundAction = new PlaySoundAction();
Assert.AreEqual(0.5, playSoundAction.Volume, "Volume should be initialized to 0.5");
}

[UITestMethod]
public void Invoke_RelativeSource_Invokes()
{
[UITestMethod]
public void Constructor_DefaultConstructor_SetsVolumeCorrectly()
{
PlaySoundAction playSoundAction = new PlaySoundAction();
Assert.AreEqual(0.5, playSoundAction.Volume, "Volume should be initialized to 0.5");
}

[UITestMethod]
public void Invoke_RelativeSource_Invokes()
{
PlaySoundAction playSoundAction = new PlaySoundAction();

playSoundAction.Source = "foo.wav";
bool result = (bool)playSoundAction.Execute(null, null);
Assert.IsTrue(result);
}

[UITestMethod]
public void Invoke_AbsoluteSource_Invokes()
{
PlaySoundAction playSoundAction = new PlaySoundAction();

playSoundAction.Source = "ms-appx:///foo.wav";
bool result = (bool)playSoundAction.Execute(null, null);
Assert.IsTrue(result);
}

[UITestMethod]
public void Invoke_InvalidSource_ReturnsFalse()
{
PlaySoundAction playSoundAction = new PlaySoundAction();

Assert.IsFalse((bool)playSoundAction.Execute(null, null),
"PlaySoundAction.Execute should return false with a null source path.");
}
PlaySoundAction playSoundAction = new PlaySoundAction();

playSoundAction.Source = "foo.wav";
bool result = (bool)playSoundAction.Execute(null, null);
Assert.IsTrue(result);
}

[UITestMethod]
public void Invoke_AbsoluteSource_Invokes()
{
PlaySoundAction playSoundAction = new PlaySoundAction();

playSoundAction.Source = "ms-appx:///foo.wav";
bool result = (bool)playSoundAction.Execute(null, null);
Assert.IsTrue(result);
}

[UITestMethod]
public void Invoke_InvalidSource_ReturnsFalse()
{
PlaySoundAction playSoundAction = new PlaySoundAction();

Assert.IsFalse((bool)playSoundAction.Execute(null, null),
"PlaySoundAction.Execute should return false with a null source path.");
}
}
Loading

0 comments on commit b304080

Please sign in to comment.