Bubba
Bubba
Explore posts from servers
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
then we'll have to do without it
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
i'll send you in pm, one sec
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
Not sure if it can cause a problem, but the main project is at the root of the repository, not in a subfolder
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
Determining projects to restore...
Restored Project/Project.Tests/Project.Tests.csproj (in 128 ms).
Restored Project/Project.csproj (in 128 ms).
Determining projects to restore...
Restored Project/Project.Tests/Project.Tests.csproj (in 128 ms).
Restored Project/Project.csproj (in 128 ms).
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
same issue :/
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
using NUnit.Framework;

namespace Browser.Tests;

public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
Assert.Pass();
}
}
using NUnit.Framework;

namespace Browser.Tests;

public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
Assert.Pass();
}
}
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
Yup, I kept the default test
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
Already tried to clean the nuget cache using dotnet nuget locals all --clear and doing dotnet clean but it does not change anything
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
When trying to start the tests using dotnet test, I get the following error:
Project/Project.Tests/UnitTest1.cs(5,6): error CS0246: The type or namespace name 'SetUpAttribute' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(5,6): error CS0246: The type or namespace name 'SetUp' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(10,6): error CS0246: The type or namespace name 'TestAttribute' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(10,6): error CS0246: The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(5,6): error CS0246: The type or namespace name 'SetUpAttribute' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(5,6): error CS0246: The type or namespace name 'SetUp' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(10,6): error CS0246: The type or namespace name 'TestAttribute' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
Project/Project.Tests/UnitTest1.cs(10,6): error CS0246: The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?) [Project/Browser.csproj]
25 replies
CC#
Created by Bubba on 10/15/2024 in #help
Issue installing NUnit
TestProject.csproj:
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Browser.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Browser.csproj" />
</ItemGroup>

</Project>
25 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
This library seems a bit strange, I'm used to libraries where you have a "game" loop and you handle events yourself, but Eto doesn't work this way. Not sure what's the name of this but you handle events with the var.Operation += ... There's a form which is basically a window and you just call a Display function and add the shapes and buttons, etc using the Content variable
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
private Button CreateSearchButton()
{
var searchButton = new Button
{
Text = "Search",
Width = 30,
Height = 30,
ToolTip = "Search",
};

searchButton.Size = new Size(40, 40);
searchButton.BackgroundColor = Colors.LightGrey;
searchButton.Shown += (sender, e) =>
{
searchButton.Style = "button { border-radius: 20px; }";
};

searchButton.Click += (sender, e) =>
{
throw new Exception("ex");
};

return searchButton;
}
private Button CreateSearchButton()
{
var searchButton = new Button
{
Text = "Search",
Width = 30,
Height = 30,
ToolTip = "Search",
};

searchButton.Size = new Size(40, 40);
searchButton.BackgroundColor = Colors.LightGrey;
searchButton.Shown += (sender, e) =>
{
searchButton.Style = "button { border-radius: 20px; }";
};

searchButton.Click += (sender, e) =>
{
throw new Exception("ex");
};

return searchButton;
}
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Hmmm which part? 😅
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
But it means that the event of a button click is still catched
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Just tried, it gets executed after the text is loaded
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Yes
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
I meant a button as example, it can be anything. A text box or button
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Hmm maybe the sleep allows the UI thread to perform other operations?
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
^
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Yes it is still responsive, but not visually. Sorry if it was not clear
58 replies