コード例 #1
0
func makeTipwastes() map[string]*wtype.LHTipwaste {
	ret := make(map[string]*wtype.LHTipwaste, 1)

	w := wtype.NewLHWell("Gilsontipwaste", "", "A1", "ul", 800000.0, 800000.0, 0, 0, 123.0, 80.0, 92.0, 0.0, "mm")
	lht := wtype.NewLHTipwaste(100, "gilsontipwaste", "gilson", 92.0, w, 49.5, 31.5, 0.0)

	ret["Gilsontipwaste"] = lht

	return ret
}
コード例 #2
0
func TestDecodeGenericPlateLHTipWaste(t *testing.T) {
	shp := wtype.NewShape("box", "mm", 123.0, 80.0, 92.0)

	w := wtype.NewLHWell("Gilsontipwaste", "", "A1", "ul", 800000.0, 800000.0, shp, 0, 123.0, 80.0, 92.0, 0.0, "mm")
	lht := *wtype.NewLHTipwaste(200, "gilsontipwaste", "gilson", 92.0, w, 49.5, 31.5, 0.0)

	enc, err := json.Marshal(lht)
	if err != nil {
		t.Fatal(err)
	}

	out, err := DecodeGenericPlate(string(enc))
	if err != nil {
		t.Fatal(err)
	}

	if reflect.TypeOf(out) != reflect.TypeOf(lht) {
		t.Fatal("expecting output type ", reflect.TypeOf(lht), " got ", reflect.TypeOf(out))
	} else if !reflect.DeepEqual(out, lht) {
		t.Fatal("The input and output contents are not the same")
	}
}