|
| 1 | +// Copyright © 2022 The CefSharp Authors. All rights reserved. |
| 2 | +// |
| 3 | +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +using CefSharp.Internals; |
| 6 | +using Xunit; |
| 7 | +using Xunit.Abstractions; |
| 8 | + |
| 9 | +namespace CefSharp.Test.Framework |
| 10 | +{ |
| 11 | + /// <summary> |
| 12 | + /// CommandLineArgsMergerTests - Test the merging of command line features |
| 13 | + /// </summary> |
| 14 | + public class CommandLineArgsMergerTests |
| 15 | + { |
| 16 | + private readonly ITestOutputHelper output; |
| 17 | + |
| 18 | + public CommandLineArgsMergerTests(ITestOutputHelper output) |
| 19 | + { |
| 20 | + this.output = output; |
| 21 | + } |
| 22 | + |
| 23 | + [Fact] |
| 24 | + public void ShouldMergeFeatures() |
| 25 | + { |
| 26 | + var expected = "A,B,C"; |
| 27 | + |
| 28 | + var actual = CommandLineArgsMerger.MergeFeatures("A,B", "C"); |
| 29 | + |
| 30 | + Assert.Equal(expected, actual); |
| 31 | + } |
| 32 | + |
| 33 | + [Fact] |
| 34 | + public void ShouldAvoidDuplicates() |
| 35 | + { |
| 36 | + var expected = "A,B,C"; |
| 37 | + |
| 38 | + var actual = CommandLineArgsMerger.MergeFeatures("A,B", "B,C"); |
| 39 | + |
| 40 | + Assert.Equal(expected, actual); |
| 41 | + } |
| 42 | + |
| 43 | + [Fact] |
| 44 | + public void ShouldTrimWhitespace() |
| 45 | + { |
| 46 | + var expected = "A,B,C"; |
| 47 | + |
| 48 | + var actual = CommandLineArgsMerger.MergeFeatures("A, B", " C "); |
| 49 | + |
| 50 | + Assert.Equal(expected, actual); |
| 51 | + } |
| 52 | + |
| 53 | + [Fact] |
| 54 | + public void ShouldHandleNull() |
| 55 | + { |
| 56 | + var expected = "A,B"; |
| 57 | + |
| 58 | + var actual = CommandLineArgsMerger.MergeFeatures("A,B", null); |
| 59 | + |
| 60 | + Assert.Equal(expected, actual); |
| 61 | + } |
| 62 | + } |
| 63 | +} |
0 commit comments