ソースを参照

SVI Добавление тестов статистике топика; 6.6%

SVI 2 年 前
コミット
d20a65716a
1 ファイル変更36 行追加0 行削除
  1. 36 0
      internal/dict_topic/topic/topic_stat/topic_stat_test.go

+ 36 - 0
internal/dict_topic/topic/topic_stat/topic_stat_test.go

@@ -0,0 +1,36 @@
+package topic_stat
+
+import "testing"
+
+/*
+	Тест для статистики топика
+*/
+
+type tester struct {
+	t *testing.T
+}
+
+func TestTopicStat(t *testing.T) {
+	sf := &tester{
+		t: t,
+	}
+	sf.create()
+}
+
+// Создание статистики
+func (sf *tester) create() {
+	sf.t.Log("create")
+	sf.createBad1()
+}
+
+// Нет сообщения
+func (sf *tester) createBad1() {
+	sf.t.Log("createBad1")
+	stat, err := NewTopicStat(nil)
+	if err == nil {
+		sf.t.Fatalf("createBad1(): err==nil")
+	}
+	if stat != nil {
+		sf.t.Fatalf("createBad1(): stat!=nil")
+	}
+}