public void create_type_with_invalid_header(string header) { ITypeDefinerScope scope = CreateTypeDefinerScope(); scope.Invoking(sut => sut.CreateType(h => h.Append(header))) .Should().Throw <InvalidOperationException>(); }
public void creating_existing_type_again_clashes(string original, string clash) { ITypeDefinerScope scope = CreateTypeDefinerScope(); scope.CreateType(original); scope.Invoking(sut => sut.CreateType(clash)).Should().Throw <ArgumentException>(); }
public void creating_type_and_finding_them_back(string decl, string finder) { ITypeDefinerScope scope = CreateTypeDefinerScope(); ITypeScope type = scope.CreateType(decl); scope.FindType(finder).Should().BeSameAs(type); scope.Invoking(sut => sut.CreateType(decl)).Should().Throw <ArgumentException>(); }
public void created_type_has_normalized_Name(string decl, string typeName) { ITypeDefinerScope scope = CreateTypeDefinerScope(); ITypeScope type = scope.CreateType(h => h.Append(decl)); type.Name.Should().Be(typeName); type.FullName.Should().Be($"{scope.FullName}.{typeName}"); scope.FindType(typeName).Should().BeSameAs(type); scope.Invoking(sut => sut.CreateType(decl)).Should().Throw <ArgumentException>(); }