Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚒️ Testing | Setup unit tests #411

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

⚒️ Testing | Setup unit tests #411

wants to merge 3 commits into from

Conversation

AntPolkanov
Copy link
Member

This PR:

  • adds xUnit with FluentAssertions, Moq.AutoMoq and Bogus
  • adds unit tests

@AntPolkanov AntPolkanov self-assigned this Feb 1, 2023
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
Copy link
Member Author

@AntPolkanov AntPolkanov Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At that point we cannot target .net5+ because Rg.Plugins package has a dependency on .NET Framework 4.7.2 https://www.nuget.org/packages/Rg.Plugins.Popup . As we are gonna use Xamarin. Mopups (a fork of Rg.Plugins) with MAUI, I will target .net7 after the merge.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes:

<PackageReference Include="Mopups" Version="1.1.0" />

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this PR will come out of draft tomorrow :)

var nextSelectedIndex = Sut.Items.IndexOf(Sut.SelectedItem) + 1;

// Act
var raisedEvent = Assert.Raises<int>(handler => Sut.ScrollToRequested += handler, handler => Sut.ScrollToRequested -= handler,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason didn't manage to get it working with FluentAssertions 😕 With Assert it works fine, but if anyone knows how to do that via FluentAssertions - please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants