Skip to content

Commit

Permalink
Add unit test for validation status
Browse files Browse the repository at this point in the history
  • Loading branch information
s-l-teichmann committed Sep 27, 2023
1 parent ff3ae16 commit 2807905
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cmd/csaf_downloader/forwarder_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file is Free Software under the MIT License
// without warranty, see README.md and LICENSES/MIT.txt for details.
//
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
// Software-Engineering: 2023 Intevation GmbH <https://intevation.de>

package main

import "testing"

func TestValidationStatusUpdate(t *testing.T) {
sv := validValidationStatus
sv.update(invalidValidationStatus)
sv.update(validValidationStatus)
if sv != invalidValidationStatus {
t.Fatalf("got %q expected %q", sv, invalidValidationStatus)
}
sv = notValidatedValidationStatus
sv.update(validValidationStatus)
sv.update(notValidatedValidationStatus)
if sv != notValidatedValidationStatus {
t.Fatalf("got %q expected %q", sv, notValidatedValidationStatus)
}
}

0 comments on commit 2807905

Please sign in to comment.