-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat #634 [Implement] The use of a toast/message notitication to indi…
…cate success or failure to a user on Reference Data, Server Administration and Engineering Model pages (#638)
- Loading branch information
Showing
52 changed files
with
715 additions
and
190 deletions.
There are no files selected for viewing
77 changes: 50 additions & 27 deletions
77
COMET.Web.Common.Tests/Services/NotificationService/NotificationServiceTestFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,80 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="NotificationServiceTestFixture.cs" company="Starion Group S.A."> | ||
// Copyright (c) 2023-2024 Starion Group S.A. | ||
// Copyright (c) 2024 Starion Group S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, Nabil Abbar | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua | ||
// | ||
// This file is part of CDP4-COMET WEB Community Edition | ||
// The CDP4-COMET WEB Community Edition is the Starion Web Application implementation of ECSS-E-TM-10-25 | ||
// Annex A and Annex C. | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the Starion Group Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// The COMET WEB Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Affero General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// The COMET WEB Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMET.Web.Common.Tests.Services.NotificationService | ||
{ | ||
using COMET.Web.Common.Services.NotificationService; | ||
|
||
using DynamicData; | ||
|
||
using FluentResults; | ||
|
||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class NotificationServiceTestFixture | ||
{ | ||
private NotificationService notificationService; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
this.notificationService = new NotificationService(); | ||
} | ||
|
||
[Test] | ||
public void VerifyNotificationService() | ||
{ | ||
var notificationService = new NotificationService(); | ||
Assert.That(notificationService.NotificationCount, Is.EqualTo(0)); | ||
Assert.That(this.notificationService.NotificationCount, Is.EqualTo(0)); | ||
|
||
this.notificationService.AddNotifications(-2); | ||
Assert.That(this.notificationService.NotificationCount, Is.EqualTo(0)); | ||
|
||
this.notificationService.AddNotifications(4); | ||
Assert.That(this.notificationService.NotificationCount, Is.EqualTo(4)); | ||
|
||
notificationService.AddNotifications(-2); | ||
Assert.That(notificationService.NotificationCount, Is.EqualTo(0)); | ||
this.notificationService.RemoveNotifications(1); | ||
Assert.That(this.notificationService.NotificationCount, Is.EqualTo(3)); | ||
|
||
notificationService.AddNotifications(4); | ||
Assert.That(notificationService.NotificationCount, Is.EqualTo(4)); | ||
this.notificationService.RemoveNotifications(-1); | ||
Assert.That(this.notificationService.NotificationCount, Is.EqualTo(3)); | ||
|
||
notificationService.RemoveNotifications(1); | ||
Assert.That(notificationService.NotificationCount, Is.EqualTo(3)); | ||
this.notificationService.RemoveNotifications(5); | ||
Assert.That(this.notificationService.NotificationCount, Is.EqualTo(0)); | ||
} | ||
|
||
notificationService.RemoveNotifications(-1); | ||
Assert.That(notificationService.NotificationCount, Is.EqualTo(3)); | ||
[Test] | ||
public void VerifyResultsList() | ||
{ | ||
Assert.Multiple(() => | ||
{ | ||
Assert.That(this.notificationService.Results, Is.Not.Null); | ||
Assert.That(this.notificationService.Results, Has.Count.EqualTo(0)); | ||
}); | ||
|
||
notificationService.RemoveNotifications(5); | ||
Assert.That(notificationService.NotificationCount, Is.EqualTo(0)); | ||
this.notificationService.Results.Add(new Result()); | ||
Assert.That(this.notificationService.Results, Has.Count.EqualTo(1)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,5 +44,3 @@ | |
</NotFound> | ||
</Router> | ||
</CascadingAuthenticationState> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.