public void ShouldReturnExpectedIdentificationOfInterfaceWhenUsingNotCachedInstanceWithSdcb() { // Given var expected = true; var interfaceIdentifierString = "ExampleInterface"; var sourceFile = "interface.ts"; var source = File.ReadAllText($"./SourceFiles/{sourceFile}"); var ast = new Sdcb_TypeScriptASTWrapper(source); // When var notCachedInterfaceIdentifier = new InterfaceResponseTypeIdentifierNotCached(); var actual = notCachedInterfaceIdentifier.Identify( interfaceIdentifierString, ast ); // Then actual.Should() .Be(expected); }
public void ShouldReturnExpectedIdentificationWhenTypeStatementIsUsedAndNotCachedWithNodeJS( string typeName, string genericName, bool isModifier, bool isArray, bool isNullable, bool expected ) { // Given var type = new TypeStatement { Name = typeName, IsModifier = isModifier, IsArray = isArray, IsNullable = isNullable, GenericTypes = new List <TypeStatement> { new TypeStatement { Name = genericName } } }; var sourceFile = "interface.ts"; var source = File.ReadAllText($"./SourceFiles/{sourceFile}"); var ast = new NodeJS_ASTWrapper(source); // When var cachedInterfaceIdentifier = new InterfaceResponseTypeIdentifierNotCached(); var actual = cachedInterfaceIdentifier.Identify( type, ast ); // Then actual.Should() .Be(expected); }