(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func TestObject_Constructors(t *testing.T) { |
| 90 | test := map[string]interface{}{ |
| 91 | "foo": 100.0, |
| 92 | } |
| 93 | |
| 94 | t.Run("reporter", func(t *testing.T) { |
| 95 | reporter := newMockReporter(t) |
| 96 | |
| 97 | value := NewObject(reporter, test) |
| 98 | |
| 99 | value.IsEqual(test) |
| 100 | value.chain.assert(t, success) |
| 101 | }) |
| 102 | |
| 103 | t.Run("config", func(t *testing.T) { |
| 104 | reporter := newMockReporter(t) |
| 105 | |
| 106 | value := NewObjectC(Config{ |
| 107 | Reporter: reporter, |
| 108 | }, test) |
| 109 | |
| 110 | value.IsEqual(test) |
| 111 | value.chain.assert(t, success) |
| 112 | }) |
| 113 | |
| 114 | t.Run("chain", func(t *testing.T) { |
| 115 | chain := newMockChain(t) |
| 116 | |
| 117 | value := newObject(chain, test) |
| 118 | |
| 119 | assert.NotSame(t, value.chain, chain) |
| 120 | assert.Equal(t, value.chain.context.Path, chain.context.Path) |
| 121 | }) |
| 122 | |
| 123 | t.Run("invalid value", func(t *testing.T) { |
| 124 | reporter := newMockReporter(t) |
| 125 | |
| 126 | value := NewObject(reporter, nil) |
| 127 | |
| 128 | value.chain.assert(t, failure) |
| 129 | }) |
| 130 | } |
| 131 | |
| 132 | func TestObject_Raw(t *testing.T) { |
| 133 | reporter := newMockReporter(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…