public void ShouldReturnSimpleIdentifierNameWhenOnlyOneNamePartIsUsed() { var name = "Environment"; var expected = SyntaxFactory.IdentifierName(name); var actual = MockedCodeFixProvider.BuildQualifiedName(name); actual.Should().BeOfType <IdentifierNameSyntax>(); actual.IsEquivalentTo(expected).Should().BeTrue(); }
public void ShouldThrowExceptionWhenNoNamePartsIsAvailable() { Action act = () => MockedCodeFixProvider.BuildQualifiedName(); var result = act.Should().Throw <ArgumentOutOfRangeException>() .And.Message.Should().StartWith("We need at least 1 name to build the correct same syntax"); }