-- readDotnetMobileBundleID --.
(t *testing.T)
| 2850 | // -- readDotnetMobileBundleID --. |
| 2851 | |
| 2852 | func TestReadDotnetMobileBundleID(t *testing.T) { |
| 2853 | t.Run("reads ApplicationId from csproj content", func(t *testing.T) { |
| 2854 | content := `<Project Sdk="Microsoft.NET.Sdk"> |
| 2855 | <PropertyGroup> |
| 2856 | <ApplicationId>com.example.myapp</ApplicationId> |
| 2857 | <TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks> |
| 2858 | </PropertyGroup> |
| 2859 | </Project>` |
| 2860 | assert.Equal(t, "com.example.myapp", readDotnetMobileBundleID(content)) |
| 2861 | }) |
| 2862 | |
| 2863 | t.Run("no ApplicationId returns empty", func(t *testing.T) { |
| 2864 | content := `<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup></PropertyGroup></Project>` |
| 2865 | assert.Empty(t, readDotnetMobileBundleID(content)) |
| 2866 | }) |
| 2867 | |
| 2868 | t.Run("ApplicationId with whitespace is trimmed", func(t *testing.T) { |
| 2869 | content := `<ApplicationId> com.example.app </ApplicationId>` |
| 2870 | assert.Equal(t, "com.example.app", readDotnetMobileBundleID(content)) |
| 2871 | }) |
| 2872 | } |
| 2873 | |
| 2874 | // -- DetectProject BundleID population --. |
| 2875 |
nothing calls this directly
no test coverage detected