home.social

#xunit — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #xunit, aggregated by home.social.

fetched live
  1. I my daily work I'm maintaining a #dotnet software containing ~5K unit tests including #WPF view model tests.

    Most of the work they do is #async, started by 'AsyncRelayCommands'. This means waiting and asserting state changes is also async. Therefore #xunit tests are waiting often for `ManualResetEventSlim' to fire triggered by 'INotifyPropertyChanged' events.

    I have wrapped this nicely in some lines of code which will result in test code being easier on the eyes in my opinion. Maybe this is useful someone else?

    For details see:

    github.com/wgross/property-cha

  2. I my daily work I'm maintaining a #dotnet software containing ~5K unit tests including #WPF view model tests.

    Most of the work they do is #async, started by 'AsyncRelayCommands'. This means waiting and asserting state changes is also async. Therefore #xunit tests are waiting often for `ManualResetEventSlim' to fire triggered by 'INotifyPropertyChanged' events.

    I have wrapped this nicely in some lines of code which will result in test code being easier on the eyes in my opinion. Maybe this is useful someone else?

    For details see:

    github.com/wgross/property-cha

  3. @xunit @bradwilson Is there already a date, when #Xunit v2 will no longer be supported (will no longer receive bug fixes or security fixes)?

  4. @xunit @bradwilson Is there already a date, when #Xunit v2 will no longer be supported (will no longer receive bug fixes or security fixes)?

  5. @bradwilson I saw your issue about #JetBrainsRider not supporting @xunit v3 with Microsoft.Testing.Platfrom v2

    With #dotnet 10 how would a minimal project using MTP v2 and #xunit v3 look like now.

    Like this?

    github.com/bitbonk/rider-mtp-v

    Or do I still need the xunit.v3.mtp-v2 package or even the bool msbuild properties
    TestingPlatformDotnetTestSupport or UseMicrosoftTestingPlatformRunner

  6. @bradwilson I saw your issue about #JetBrainsRider not supporting @xunit v3 with Microsoft.Testing.Platfrom v2

    With #dotnet 10 how would a minimal project using MTP v2 and #xunit v3 look like now.

    Like this?

    github.com/bitbonk/rider-mtp-v

    Or do I still need the xunit.v3.mtp-v2 package or even the bool msbuild properties
    TestingPlatformDotnetTestSupport or UseMicrosoftTestingPlatformRunner

  7. Apparently #tunit runs a lot more in parallel compared to #xunit.

    It also uses source generation so test discovery is a lot faster.

    #dotnet

    youtube.com/watch?v=S11Moa7kfP

  8. Apparently #tunit runs a lot more in parallel compared to #xunit.

    It also uses source generation so test discovery is a lot faster.

    #dotnet

    youtube.com/watch?v=S11Moa7kfP

  9. I just spent 4 hours writing #XUnit tests to prove a point. Constructive pedantry!

  10. I just spent 4 hours writing #XUnit tests to prove a point. Constructive pedantry!

  11. xUnit Test Patterns: Contract Test — zalas.pl/contract-test/

    Contract Tests are examples that describe the behaviour of an abstraction by expressing what cannot be encoded in the type system. These are typically helpful in testing adapters as defined in the Ports & Adapters architecture.

    Examples in #kotlin, but the pattern is universal.

    #contracttests #xunit #testing #hexagonal #portsandadapters

  12. xUnit Test Patterns: Contract Test — zalas.pl/contract-test/

    Contract Tests are examples that describe the behaviour of an abstraction by expressing what cannot be encoded in the type system. These are typically helpful in testing adapters as defined in the Ports & Adapters architecture.

    Examples in #kotlin, but the pattern is universal.

    #contracttests #xunit #testing #hexagonal #portsandadapters

  13. dev.to/gsferreira/taking-contr - in #dotNET, #xUnit test names can get weird. `[Fact(DisplayName = "This is the test name")] public void ...` Or take control by convention with xunit.runner.json. Nice walk-through linkedin.com/in/gferreira.

  14. dev.to/gsferreira/taking-contr - in #dotNET, #xUnit test names can get weird. `[Fact(DisplayName = "This is the test name")] public void ...` Or take control by convention with xunit.runner.json. Nice walk-through linkedin.com/in/gferreira.

  15. Искусство Unit-тестирования: Сокращаем Arrange до Нуля

    Unit-тесты очень важно и нужно писать, но вот незадача — на них никогда не хватает времени! Прочитав эту статью, вы узнаете абсолютно новый способ их написания, который сэкономит кучу времени и нервов. Эта статья будет полезна .NET разработчикам, которые когда-либо сталкивались с написанием unit тестов, а также тим и техлидам в поиске оптимальной практики для своей команды.

    habr.com/ru/companies/ruvds/ar

    #unit_tests #csharp #dotnet #autofixture #xunit #autodata #ruvds_статьи

  16. GraphQL для C#. БД прилагается

    Приветствую, Хабр! Относительно недавно я решил влиться в С# и его технологию для создания веб-приложений ASP.NET. До этого писал в основном на С++ и Python с Django. Ну а так как я по жизни практик, то и чтоб чему-то научиться, надо что-то сделать, пусть и корявенькое (хотя пару книжек, конечно, прочитал). Выбор пал на стандартное приложение магазина книг, а точнее его бэк составляющую, ибо с дизайном и любыми, даже базовыми, проявлениями фронтовой части я не дружу от слова совсем) Вначале сделал приложение с базовыми контролерами REST API по учебнику и т.д. Но после захотелось попробовать уже другой вариант, и я решил использовать GraphQL...

    habr.com/ru/articles/870082/

    #hotchocolate #graphql #xunit #entityframework #aspnet

  17. @djlink experienced this yesterday. Wrote a parameterized unit test with 6 rows with #MSTest and it took a minute to run them all. Switched to #xUnit and took 72ms. I felt like the boiled frog. I had noticed #MSTest getting slower but didn't think it had gotten that bad.

  18. @djlink experienced this yesterday. Wrote a parameterized unit test with 6 rows with and it took a minute to run them all. Switched to and took 72ms. I felt like the boiled frog. I had noticed getting slower but didn't think it had gotten that bad.

  19. meziantou.net/how-to-view-logs - connect #xUnit's ITestOutputHelper to #ASPnet's ILogger<T>. Now I get ASP.NET console logs in my test output including EF queries. Nice tool linkedin.com/in/meziantou/.

  20. meziantou.net/how-to-view-logs - connect #xUnit's ITestOutputHelper to #ASPnet's ILogger<T>. Now I get ASP.NET console logs in my test output including EF queries. Nice tool linkedin.com/in/meziantou/.

  21. My talk went great! :-)

    I had a full "room"!

    And here is my promised repo on dealing with integration tests in #dotnet

    You can see #testcontainers utilized, #docker, #xunit custom parallel framework, #NSubstitute, #TestServer and all in #csharp testing e2e #HTTP #APIs with #auth, #MySQL, #Redis, #RabbitMQ and #MongoDB.

    github.com/vmandic/dotnet-inte

  22. My talk went great! :-)

    I had a full "room"!

    And here is my promised repo on dealing with integration tests in #dotnet

    You can see #testcontainers utilized, #docker, #xunit custom parallel framework, #NSubstitute, #TestServer and all in #csharp testing e2e #HTTP #APIs with #auth, #MySQL, #Redis, #RabbitMQ and #MongoDB.

    github.com/vmandic/dotnet-inte

  23. Just discovered I have always used #xUnit's theories incorrectly: they are more about properties than reducing duplication.

    They are way more fascinating than I thought

    arialdomartini.github.io/xunit

    @xunit @bradwilson

  24. Just discovered I have always used #xUnit's theories incorrectly: they are more about properties than reducing duplication.

    They are way more fascinating than I thought

    arialdomartini.github.io/xunit

    @xunit @bradwilson

  25. If you are using #Rider and your team uses #xunit traits that you don’t care about and just pollutes the Test Explorer, then help me upvote this feature to hide Test Categories: youtrack.jetbrains.com/issue/R

  26. A post more for me than anyone else. How to test C# clients which use HttpClient WITHOUT using Moq.
    Unit Testing Umami.Net - Testing Umami Data Without Using Moq
    mostlylucid.net/blog/unittesti
    #xunit #aspnetcore

  27. A post more for me than anyone else. How to test C# clients which use HttpClient WITHOUT using Moq.
    Unit Testing Umami.Net - Testing Umami Data Without Using Moq
    mostlylucid.net/blog/unittesti
    #xunit #aspnetcore

  28. New small article on a problem I was having Unit Testing Logging with ASP.NET Core. And the new (to me) package I found to solve it.
    mostlylucid.net/blog/unittesti
    #xunit #aspnetcore