mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
32 lines
996 B
C#
32 lines
996 B
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
using Xunit;
|
|
|
|
namespace System.Net.Primitives.Functional.Tests
|
|
{
|
|
public partial class CookieContainerTest
|
|
{
|
|
[Fact]
|
|
public static void AddCookieCollection_Null_Throws()
|
|
{
|
|
CookieContainer cc = new CookieContainer();
|
|
CookieCollection cookieCollection = null;
|
|
Assert.Throws<ArgumentNullException>(() => cc.Add(cookieCollection));
|
|
}
|
|
|
|
[Fact]
|
|
public static void AddCookieCollection_Success()
|
|
{
|
|
CookieContainer cc = new CookieContainer();
|
|
CookieCollection cookieCollection = new CookieCollection();
|
|
cookieCollection.Add(new Cookie("name3", "value","/",".contoso.com"));
|
|
cc.Add(cookieCollection);
|
|
Assert.Equal(1, cc.Count);
|
|
}
|
|
}
|
|
}
|