-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: #5: system types cannot be included as mixins
All types that are stored in CLR module cannot be included as mixins
- Loading branch information
Showing
6 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace MixinRefactoring.Test | ||
{ | ||
[TestFixture] | ||
public class MixinCommandTest | ||
{ | ||
[Test] | ||
public void ClassWithNativeFields_CanExecuteMixinCommand_CannotExecute() | ||
{ | ||
// arrange | ||
// 1. load source files and get class and mixin declarations | ||
var sourceCode = new SourceCode("Person.cs"); | ||
var personClass = sourceCode.Class("PersonWithNativeTypes"); | ||
var fieldDeclarations = personClass.DescendantNodes().OfType<FieldDeclarationSyntax>(); | ||
|
||
foreach(var fieldDeclaration in fieldDeclarations) | ||
{ | ||
var mixinCommand = new MixinCommand(sourceCode.Semantic, fieldDeclaration); | ||
Assert.IsFalse(mixinCommand.CanExecute()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters