(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestDomainStatus(t *testing.T) { |
| 267 | tests := []struct { |
| 268 | name string |
| 269 | stats DomainRequestStats |
| 270 | expected string |
| 271 | }{ |
| 272 | {name: "allowed only", stats: DomainRequestStats{Allowed: 5, Blocked: 0}, expected: "allowed"}, |
| 273 | {name: "denied only", stats: DomainRequestStats{Allowed: 0, Blocked: 3}, expected: "denied"}, |
| 274 | {name: "mixed", stats: DomainRequestStats{Allowed: 2, Blocked: 1}, expected: "mixed"}, |
| 275 | {name: "zero requests", stats: DomainRequestStats{Allowed: 0, Blocked: 0}, expected: "unknown"}, |
| 276 | } |
| 277 | |
| 278 | for _, tt := range tests { |
| 279 | t.Run(tt.name, func(t *testing.T) { |
| 280 | result := classifyFirewallDomainStatus(tt.stats) |
| 281 | assert.Equal(t, tt.expected, result, "Domain status should match") |
| 282 | }) |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | func TestFormatVolumeChange(t *testing.T) { |
| 287 | tests := []struct { |
nothing calls this directly
no test coverage detected