99.9 % coverage & full OpenAPI v3 support

A single line that tries to read an HTTP response body and fails is very hard to test without mocking, and the mock does not add value to a single line of code to check for an error that can rarely ever be triggered. Going to settle for 99.9% for now.
This commit is contained in:
Dave Shanley
2022-08-31 10:04:39 -04:00
parent 62a7c88631
commit 0de0c16c0c
6 changed files with 530 additions and 67 deletions

View File

@@ -0,0 +1,30 @@
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
// SPDX-License-Identifier: MIT
package index
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestCircularReferenceResult_GenerateJourneyPath(t *testing.T) {
refs := []*Reference{
{Name: "chicken"},
{Name: "nuggets"},
{Name: "chicken"},
{Name: "soup"},
{Name: "chicken"},
{Name: "nuggets"},
{Name: "for"},
{Name: "me"},
{Name: "and"},
{Name: "you"},
}
cr := &CircularReferenceResult{Journey: refs}
assert.Equal(t, "chicken -> nuggets -> chicken -> soup -> "+
"chicken -> nuggets -> for -> me -> and -> you", cr.GenerateJourneyPath())
}