mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
- Migrate module path to github.com/hanzoai/pack across all Go packages - Remove legacy upstream docs and competitor brand references - Modernize LLM.md and mise.toml for pristine Hanzo Pack builder
47 lines
877 B
Go
47 lines
877 B
Go
package dotnet
|
|
|
|
import (
|
|
"testing"
|
|
|
|
testingUtils "github.com/hanzoai/pack/core/testing"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestDotnet(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
path string
|
|
detected bool
|
|
}{
|
|
{
|
|
name: "dotnet project",
|
|
path: "../../../examples/dotnet-cli",
|
|
detected: true,
|
|
},
|
|
{
|
|
name: "non-dotnet project",
|
|
path: "../../../examples/node-npm",
|
|
detected: false,
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
ctx := testingUtils.CreateGenerateContext(t, tt.path)
|
|
provider := DotnetProvider{}
|
|
|
|
detected, err := provider.Detect(ctx)
|
|
require.NoError(t, err)
|
|
require.Equal(t, tt.detected, detected)
|
|
|
|
if detected {
|
|
err = provider.Initialize(ctx)
|
|
require.NoError(t, err)
|
|
|
|
err = provider.Plan(ctx)
|
|
require.NoError(t, err)
|
|
}
|
|
})
|
|
}
|
|
}
|