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

Classes contain structs #96

Closed
LilBulb1337 opened this issue Jul 22, 2021 · 3 comments · Fixed by #137
Closed

Classes contain structs #96

LilBulb1337 opened this issue Jul 22, 2021 · 3 comments · Fixed by #137
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@LilBulb1337
Copy link

LilBulb1337 commented Jul 22, 2021

I would expect this test not to fail in a code base with classes and structs.
It would be nice to have Structs separately.

using ArchUnitNET.Fluent;
using ArchUnitNET.NUnit;
using NUnit.Framework;
using static ArchUnitNET.Fluent.ArchRuleDefinition;

namespace PostSolutionTests
{
    class ClassesShouldNotBeStructs
    {
        private static readonly IArchRule ClassesShouldNotBeStructsRule = Classes().Should().NotBeStructs();

        [Test, Category("ArchUnitTest")]
        public static void ClassesShouldNotBeStructsTests() => ClassesShouldNotBeStructsRule.Check(Architecture.Dialux);
    }
}
@fgather
Copy link
Contributor

fgather commented Jul 22, 2021

Thanks for the valuable input. I'd assume that we have the same problem with records.

@LilBulb1337
Copy link
Author

Afaik records are classes internally, though there might be some way to discern them through some attributes or so.

@fgather fgather added the kind/bug Categorizes issue or PR as related to a bug. label Aug 19, 2021
@fgather
Copy link
Contributor

fgather commented Dec 1, 2021

Released in 0.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants