Murphy
Murphy
CC#
Created by Murphy on 7/21/2023 in #help
❔ Textmate themes for custom languages?
So it's apparently possible to add support for custom syntax highlighting via textmate grammars according to https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/TextmateGrammar . I can find no other documentation online about doing this with Visual Studio though. I'm just trying to highlight multiple keywords in a different color in my custom language, but I have absolutely no idea if I'm doing this correctly since I'm getting
System.InvalidOperationException: IWpfTextView.TextViewLines is invalid.
at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.Microsoft.VisualStudio.Text.Editor.IWpfTextView.get_TextViewLines()
System.InvalidOperationException: IWpfTextView.TextViewLines is invalid.
at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.Microsoft.VisualStudio.Text.Editor.IWpfTextView.get_TextViewLines()
whenever I try to use the tmTheme file and then open the file. If I leave it out, it seems to work and match my two regexes fine. They're just the same color. Is there a way to actually specify the colors?
2 replies
CC#
Created by Murphy on 7/1/2023 in #help
❔ NuGet dependency Hell
I'm getting a bunch of System.IO.FileLoadException but resolving I can't resolve it. The FusionLog is saying 'Microsoft.EntityFrameworkCore, Version=3.1.32.0' is trying to load 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.32.0'. Makes sense; so I figure I just have the wrong version referenced. Nuget had 3.1.0, so I upgrade to 3.1.32 but now 'Microsoft.Extensions.Logging, Version=3.1.32.0' is trying to load 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.0.0' WTF? How, why would it be trying to load that older version? Can I reference both versions or do a binding redirect or something for a specific calling assembly? I have no idea what to do here.
15 replies
CC#
Created by Murphy on 6/26/2023 in #help
❔ xUnit - totally isolated serial parameterized tests?
Hopefully someone with more experience with different testing frameworks can help me out- I'm not married to using only xUnit. Though this isn't for unit testing since the test conditions depend on the file system/database state, I'm starting with xUnit just because my unit tests used it. I'm trying to find a good way to do parameterized integration tests. xUnit supports using ClassData and MemberData attributes to provide the parameters to the tests, but after a while, I found out that all the strange behavior I was seeing was due to xUnit creating instances of the parameters for all tests, all at the same time, before any test runs.
[Theory, MemberData(nameof(StorageSystemUnderTest))]
public async Task TestWriteNotification(IPersistentDataStorage sut){...}

[Theory, MemberData(nameof(StorageSystemUnderTest))]
public async Task TestAutoReload(IPersistentDataStorage sut){...}

public static IEnumerable<object[]> StorageSystemUnderTest =>
new List<object[]>
{
new object[] { GetInMemoryStorage() },
new object[] { GetSystemFileStorage() },
new object[] { GetDatabaseStorage() },
...
};
[Theory, MemberData(nameof(StorageSystemUnderTest))]
public async Task TestWriteNotification(IPersistentDataStorage sut){...}

[Theory, MemberData(nameof(StorageSystemUnderTest))]
public async Task TestAutoReload(IPersistentDataStorage sut){...}

public static IEnumerable<object[]> StorageSystemUnderTest =>
new List<object[]>
{
new object[] { GetInMemoryStorage() },
new object[] { GetSystemFileStorage() },
new object[] { GetDatabaseStorage() },
...
};
This is a no-go since the multiple IPersistentDataStorage objects will try to register multiple handlers with the storage providers (ie. file watchers) all at the same time and I can't have that. Is there another testing framework that would let me better control object lifetimes for use in integration tests or at least some other way to use xUnit to run tests completely serially?
14 replies