當前位置: 首頁>>代碼示例>>Golang>>正文


Golang gompcreader.MinorPlanet類代碼示例

本文整理匯總了Golang中github.com/wselwood/gompcreader.MinorPlanet的典型用法代碼示例。如果您正苦於以下問題:Golang MinorPlanet類的具體用法?Golang MinorPlanet怎麽用?Golang MinorPlanet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了MinorPlanet類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestYearOfFirstObsExtractor

func TestYearOfFirstObsExtractor(t *testing.T) {
	extractor := YearOfFirstObsExtractor{1915}
	for _, tt := range yearOfFirstObsTestCases {
		var input gompcreader.MinorPlanet
		input.YearOfFirstObservation = tt.in
		assert.Equal(t, tt.outCell, extractor.ExtractCell(&input), "incorrect cell %d %d", tt.in, tt.outCell)
		assert.Equal(t, tt.out, extractor.Extract(&input), "incorrect message %d %s", tt.in, tt.out)
	}
}
開發者ID:wselwood,項目名稱:astro-grid,代碼行數:9,代碼來源:extractors_test.go

示例2: TestAbsoluteMagnitudeExtractor

func TestAbsoluteMagnitudeExtractor(t *testing.T) {
	extractor := AbsoluteMagnitudeExtractor{30, 10.0, 1.5, 3}
	for _, tt := range absoluteMagnitudeTestCases {
		var input gompcreader.MinorPlanet
		input.AbsoluteMagnitude = tt.in

		assert.Equal(t, tt.outCell, extractor.ExtractCell(&input), "incorrect cell %f %d", tt.in, tt.outCell)
		assert.Equal(t, tt.out, extractor.Extract(&input), "incorrect message %f %s", tt.in, tt.out)
	}
}
開發者ID:wselwood,項目名稱:astro-grid,代碼行數:10,代碼來源:extractors_test.go

示例3: TestSemimajorAxisExtractor

func TestSemimajorAxisExtractor(t *testing.T) {
	extractor := SemimajorAxisExtractor{10.0, 10}
	for _, tt := range semimajorAxisTestCases {
		var input gompcreader.MinorPlanet
		input.SemimajorAxis = tt.in

		assert.Equal(t, tt.outCell, extractor.ExtractCell(&input), "incorrect cell %f %d", tt.in, tt.outCell)
		assert.Equal(t, tt.out, extractor.Extract(&input), "incorrect message %f %s", tt.in, tt.out)
	}
}
開發者ID:wselwood,項目名稱:astro-grid,代碼行數:10,代碼來源:extractors_test.go

示例4: TestInclinationToTheEclipticExtractor

func TestInclinationToTheEclipticExtractor(t *testing.T) {
	extractor := InclinationToTheEclipticExtractor{}
	for _, tt := range inclinationTestCases {
		var input gompcreader.MinorPlanet
		input.InclinationToTheEcliptic = tt.in

		assert.Equal(t, tt.outCell, extractor.ExtractCell(&input), "incorrect cell %f %d", tt.in, tt.outCell)
		assert.Equal(t, tt.out, extractor.Extract(&input), "incorrect message %f %s", tt.in, tt.out)
	}
}
開發者ID:wselwood,項目名稱:astro-grid,代碼行數:10,代碼來源:extractors_test.go

示例5: TestOrbitalEccentricityExtractor

func TestOrbitalEccentricityExtractor(t *testing.T) {
	extractor := OrbitalEccentricityExtractor{}
	for _, tt := range orbitalEccentricityTestCases {
		var input gompcreader.MinorPlanet
		input.OrbitalEccentricity = tt.in

		assert.Equal(t, tt.outCell, extractor.ExtractCell(&input), "incorrect cell %f %d", tt.in, tt.outCell)
		assert.Equal(t, tt.out, extractor.Extract(&input), "incorrect message %f %s", tt.in, tt.out)
	}
}
開發者ID:wselwood,項目名稱:astro-grid,代碼行數:10,代碼來源:extractors_test.go

示例6: TestPerihelionExtractor

/*
TestApohelionExtractor tests basic apohelion results
*/
func TestPerihelionExtractor(t *testing.T) {
	extractor := PerihelionExtractor{10, 10.0}
	for _, tt := range perihelionTestCases {
		var input gompcreader.MinorPlanet

		input.SemimajorAxis = tt.inSemimajorAxis
		input.OrbitalEccentricity = tt.inOrbitalEccentricity
		assert.Equal(t, tt.outCell, extractor.ExtractCell(&input), "incorrect cell")
		assert.Equal(t, tt.out, extractor.Extract(&input), "incorrect message")
	}
}
開發者ID:wselwood,項目名稱:astro-grid,代碼行數:14,代碼來源:extractors_test.go


注:本文中的github.com/wselwood/gompcreader.MinorPlanet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。