-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add GetValue methods to INavigationParameter (#308)
added tests added test fixed comments fixed error fixing approval tests
- Loading branch information
1 parent
71b6a0b
commit 08d71c5
Showing
5 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using FluentAssertions; | ||
using Xunit; | ||
|
||
namespace Sextant.Tests | ||
{ | ||
/// <summary> | ||
/// Tests <see cref="NavigationParameter"/> and extensions. | ||
/// </summary> | ||
public class NavigationParameterTests | ||
{ | ||
/// <summary> | ||
/// Tests the method gets a value. | ||
/// </summary> | ||
[Fact] | ||
public void Should_Get_Value() | ||
{ | ||
// Given | ||
NavigationParameter sut = new(); | ||
sut.Add("key", TimeSpan.Zero); | ||
|
||
// When | ||
var result = sut.GetValue<TimeSpan>("key"); | ||
|
||
// Then | ||
result | ||
.Should() | ||
.Be(TimeSpan.Zero); | ||
} | ||
|
||
/// <summary> | ||
/// Tests the method tries to gets a value. | ||
/// </summary> | ||
[Fact] | ||
public void Should_Try_Get_Value() | ||
{ | ||
// Given | ||
NavigationParameter sut = new(); | ||
sut.Add("key", TimeSpan.Zero); | ||
|
||
// When | ||
var result = sut.TryGetValue<TimeSpan>("key", out var value); | ||
|
||
// Then | ||
result | ||
.Should() | ||
.BeTrue(); | ||
} | ||
} | ||
} |
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