Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add test scene for setup screen | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Screens.Edit;
using osu.Game.Scr... | |
Add equality check test to ensure correct values | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Game.Beatmaps;
namespace osu.Game.Tests.NonVisual
{
[TestFixture]
public class BeatmapSetInfoEqualityTest
{
[Test]
... | |
Add in byte array serializer | using Microsoft.ServiceFabric.Data;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServiceFabric.Bond
{
public class ByteArrayStateSerializer : IStateSerializer<byte[]>
{
public byte[] Read(BinaryReader bin... | |
Increase R version cap to 3.9 | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
namespace Microsoft.R.Actions.Utility {
public static class SupportedRVersionList {
// TODO: this probably needs configuration file
... | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
namespace Microsoft.R.Actions.Utility {
public static class SupportedRVersionList {
// TODO: this probably needs configuration file
... |
Allow to specify which package to assert against | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using NuGet;
namespace NuProj.Tests.Infrastructure
{
public static class Scenario
{
public static async Task<IPackage> RestoreAndBuildSinglePackage(string scenarioName, IDictionary<string... | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using NuGet;
namespace NuProj.Tests.Infrastructure
{
public static class Scenario
{
public static async Task<IPackage> RestoreAndBuildSinglePackage(string scenarioName, string packageId =... |
Add view model factory interface | using ZobShop.ModelViewPresenter.Product.Details;
namespace ZobShop.ModelViewPresenter
{
public interface IViewModelFactory
{
ProductDetailsViewModel CreateProductDetailsViewModel(string name, string category, decimal price, double volume, string maker);
}
}
| |
Add [ThreadSafe] attribute so it can be used for documentation purpose (not just for bindings) | //
// ThreadSafe attribute
//
// Copyright 2012, Xamarin Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, cop... | |
Add test for winforms converters. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AgateLib;
using AgateLib.DisplayLib;
using AgateLib.Geometry;
using AgateLib.WinForms;
namespace Tests.WinFormsTests
{
class Converters : AgateApplication, IAgateTest
{
public string Name
{
get { retur... | |
Add generator test for REPEAT | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Oberon0.Generator.Msil.Tests.Statements
{
using System.IO;
using NUnit.Framework;
using Oberon0.Compiler;
using Oberon0.Compiler.Definitions;
[TestFixture]
public cl... | |
Fix Windows file format issues | /*
Copyright © Iain McDonald 2010-2019
This file is part of Decider.
Unlike the Expression type which is wholly supported on its own, the MetaExpression relies
on the values of other supporting variables. Thus, if those variables change, the bounds
of the MetaExpression need to be re-evaluated.
*... | |
Implement calculation of absolute position in the document text, given a line and column number. | using System;
using MSBuildProjectTools.LanguageServer.XmlParser;
namespace MSBuildProjectTools.LanguageServer.Utilities
{
/// <summary>
/// A quick-and-dirty calculator for text positions.
/// </summary>
/// <remarks>
/// This could easily be improved by also storing a character sub-total ... | |
Add coverage for operation tracker with failing tests | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using NUnit.Framework;
using osu.Framework.Bindables;
using osu.Framework.Testing;
using osu.Game.Screens.OnlinePlay;
using osu.Game.Tests.Visual;
namespac... | |
Add static file options startup sample | using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace WebApp
{
/// <summary>
/// Startup configuration example with use... | |
Update link to SharpaDoc on github | @*
// Copyright (c) 2010-2013 SharpDoc - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, ... | @*
// Copyright (c) 2010-2013 SharpDoc - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, ... |
Make sure async API tests are testing what we think they’re testing | // ***********************************************************************
// Copyright (c) 2018 Charlie Poole, Rob Prouse
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restri... | |
Implement utlity for httprequest as string | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Schedutalk.Logic
{
class HttpRequestor
{
public async Task<string> getHttpRequestAsString(Func<string, HttpRequestMessage> requestTask, string input)
... | |
Add empty Startup configuration service implementation | namespace GeekLearning.Test.Integration.Environment
{
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
public class StartupConf... | |
Add serviceable attribute to projects. | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Reflection;
[assembly: AssemblyMetadata("Serviceable", "True")] | |
Support meta-data to define config relationship between classes | using System;
namespace Zyborg.Vault.Server.Util
{
/// <summary>
/// This attribute allows you to specify what type is used to configure
/// the behavior of another type instance, such as a service provider.
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = tr... | |
Add sample of an HTTP function integration test | // Copyright 2020 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | |
Add test scene for visually adjusting mania `BarLine`s | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania... | |
Add an abstraction for either reporting an array or results, or streaming them in LSP scenarios. | // 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 more information.
#nullable enable
using System;
using Microsoft.CodeAnalysis.PooledObjects;
namespace Microsoft.CodeAnalysis.Langu... | |
Test to repro multiple subscribers issue | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MassTransit.Tests.TextFixtures;
using MassTransit.TestFramework;
using MassTransit.BusConfigurators;
using NUnit.Framework;
using Magnum.TestFramework;
using Magnum;
using Magnum.Extensions;
namespace MassTransit.Tests.Subscri... | |
Add test cases for ViewModels.AboutWindowViewModel | using Microsoft.VisualStudio.TestTools.UnitTesting;
using ThScoreFileConverter.Models;
using ThScoreFileConverter.Properties;
using ThScoreFileConverter.ViewModels;
namespace ThScoreFileConverterTests.ViewModels
{
[TestClass]
public class AboutWindowViewModelTests
{
[TestMethod]
public voi... | |
Add test suite with tests for MySQL 5.6 | using System;
using System.Diagnostics;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.Enti... | |
Add test coverage of startup ruleset being non-default | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Development;
using osu.Game.Configuration;
namespace osu.Game.Tests.Visual.Navigation
{
[TestFixture]
public class Te... | |
Add missing file in the previous commit. | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using NuGet;
using NuGetPackageExplorer.Types;
namespace PackageExplorerViewModel.Rules {
[Export(typeof(IPackageRule))]
internal class NonAssemblyReferenceName : IPackageRule... | |
Add Interleaved 2 of 5 Barcode | using System;
using System.Collections.Generic;
namespace BinaryKits.Utility.ZPLUtility.Elements
{
/// <summary>
/// Interleaved 2 of 5 Barcode
/// </summary>
public class ZPLBarCodeInterleaved2of5 : ZPLBarcode
{
public bool Mod10CheckDigit { get; private set; }
public ZPLBarCode... | |
Add unit tests covering update | using System;
using System.Xml.Linq;
using Buildalyzer.Construction;
using NUnit.Framework;
using Shouldly;
namespace Buildalyzer.Tests.Construction
{
[TestFixture]
public class PackageReferenceFixture
{
[Test]
public void PackageReferenceWithInclude_Should_ContainName()
{
... | |
Add one unit test to a new method | using FonctionsUtiles.Fred.Csharp;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
namespace TestProjectCoreUseFulFunctions
{
[TestClass]
public class UnitTestFunctionsString
{
[DataTestMethod]
[TestCategory("String")]
public void TestMethod_SplitString_One... | |
Add abstraction for connection string | namespace ServiceBus.AttachmentPlugin
{
/// <summary>
/// Storage account connection string provider.
/// </summary>
public interface IProvideStorageConnectionString
{
/// <summary>
/// Connection string for storage account to be used.
/// </summary>
string GetConnec... | |
Add full screen initialization test. | using System;
using System.Collections.Generic;
using AgateLib;
using AgateLib.DisplayLib;
using AgateLib.Geometry;
using AgateLib.InputLib;
namespace Tests.DisplayTests
{
class HelloWorldProgram : IAgateTest
{
public string Name
{
get { return "Full Screen"; }
}
public string Category
... | |
Add test coverage of `ShearedOverlayContainer` | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graph... | |
Allow event handler to have many IHandleEventOf<T> implementation and ensure the most relevent Handle method is invoked | using System;
using System.Collections.Generic;
namespace JustGiving.EventStore.Http.SubscriberHost
{
/// <summary>
/// Compares Types resulting in the most derived being at the top
/// </summary>
public class TypeInheritanceComparer : IComparer<Type>
{
public int Compare(Type x, Type y)
... | |
Add Test for removing readonly flag when copying readonly library assets | // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using FluentAssertions;
using Xunit;
using Microsoft.DotNet.Cli.Compiler.Common;
using Microsoft.DotNet.ProjectModel.Compilation;
using System.IO... | |
Add option for fixed provider | using System.Collections.Generic;
using System.Linq;
namespace Glimpse.Web
{
public class FixedRequestAuthorizerProvider : IRequestAuthorizerProvider
{
public FixedRequestAuthorizerProvider()
: this(Enumerable.Empty<IRequestAuthorizer>())
{
}
public FixedRequestAut... | |
Read and update time zone settings | // CSOM Package (16.1.3912.1204)
// Gets and sets the current Time Zone settings from the given SharePoint site
// Get access to source site
using (var ctx = new ClientContext("https://spknowledge.sharepoint.com"))
{
//Provide count and pwd for connecting to the source
var passWord = new SecureString()... | |
Add bubbled word class for use in attribute rows | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.Contro... | |
Add visual test for Tournament Mod Display | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Onli... | |
Add fixed implementation for RequestRuntime provider | using System.Collections.Generic;
using System.Linq;
namespace Glimpse.Web
{
public class FixedRequestRuntimeProvider : IRequestRuntimeProvider
{
public FixedRequestRuntimeProvider()
: this(Enumerable.Empty<IRequestRuntime>())
{
}
public FixedRequestRuntimeProvider... | |
Test to repro multiple subscribers issue | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MassTransit.Tests.TextFixtures;
using MassTransit.TestFramework;
using MassTransit.BusConfigurators;
using NUnit.Framework;
using Magnum.TestFramework;
using Magnum;
using Magnum.Extensions;
namespace MassTransit.Tests.Subscri... | |
Add a test scene for non-top level menus | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Testing;
namespace osu.Framework.Tests.Visual.UserIn... | |
Add failing tests for in parameters | using NUnit.Framework;
namespace ApiContractGenerator.Tests.Integration
{
public sealed class SignatureTests : IntegrationTests
{
[Test]
public static void Ref_readonly_method_parameter_should_use_in()
{
Assert.That("public struct A { public void Test(in int x) { } }", HasCo... | |
Create view model for tracking last logs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Baskerville.Models.ViewModels
{
public class LastLogsViewModel
{
public string Username { get; set; }
public DateTime Date { get; set; }
}
}
| |
Add ExtensionMethod class for supporting functions. Added function to shift number of decimal points | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LogFilterApplication
{
public static class ExtensionMethods
{
public static string ShiftDecimalPoint(double inputNumber, int decimalToShift)
{
string retVal = "";
inputNumbe... | |
Revert "GraphQL: Default to use builtin GUID primitives" | using System;
using GraphQL.Language.AST;
using GraphQL.Types;
namespace GraphQL.Types
{
public class GuidGraphType : ScalarGraphType
{
public GuidGraphType()
{
Name = "Guid";
Description = "Globally Unique Identifier.";
}
public override object ParseVa... | |
Add delivery client factory simple tests | using FakeItEasy;
using FluentAssertions;
using Kentico.Kontent.Delivery.Abstractions;
using Kentico.Kontent.Delivery.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace Kentico.Kon... | |
Add partial class for retry settings | // Copyright 2019 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | |
Add test file for FileCallbackResult action | using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NUnit.Framework;
using NUnit.Framework.Internal;
using SFA.DAS.CommitmentsV2.Shared.ActionResults;
namespace SFA.DAS.CommitmentsV2.Shared.UnitTests.ActionResults
{
... | |
Add event handler for picking up prizes | using UnityEngine;
using UnityEngine.Assertions;
[RequireComponent(typeof(AudioSource))]
//uses mp3 for music, and ogg for sound effects
public class SoundManager : BaseBehaviour
{
public AudioClip collectPrize;
private new AudioSource audio;
void Awake()
{
audio = GetComponent<AudioSource>();
Assert.IsNotNu... | |
Add file to the last commit | using System;
using System.Runtime.Serialization;
using NUnit.Framework;
namespace Lokad.Cqrs.Feature.AtomicStorage
{
[TestFixture, Explicit]
public sealed class Stand_alone_tests
{
// ReSharper disable InconsistentNaming
[Test]
public void Test()
{
... | |
Add DeleteMessage Job & TriggerQueue | using Quartz;
using System;
using System.Threading.Tasks;
using Discord;
using Microsoft.Extensions.DependencyInjection;
using NLog;
namespace NoAdsHere.Services.Penalties
{
public static class JobQueue
{
private static IScheduler _scheduler;
public static Task Install(IServiceProvider provid... | |
Add properties file for donet | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Roc... | |
Add generic ILogger<> registration for Unity | // Problem: You need to register in Unity factory method that has single type parameters (a.k.a generic) to produce some generics
// var logger = ILoggerFactory.CreateLogger<T>()
// var logger = container.Resolve<ILogger<T>>();
public static class LoggerFactoryExtensions
{
/// <summary>
/// Creates a new ... | |
Add extension method to check value is in specified range | namespace SCPI.Extensions
{
public static class ValueTypeExtensions
{
/// <summary>
/// Checks that the value is within specified range
/// </summary>
/// <param name="value">Value to check</param>
/// <param name="minValue">The inclusive lower bound</param>
/// ... | |
Create basic class representing an API instance. | using System;
namespace PortableWordPressApi
{
public class WordPressApi
{
public Uri ApiRootUri
{
get;
internal set;
}
}
}
| |
Add charting for user comments stats | @model IEnumerable<OCM.API.Common.DataSummary.GeneralStats>
<canvas id="userCommentsChart" width="280" height="200"></canvas>
<script>
//Get the context of the canvas element we want to select
var ctx = document.getElementById("userCommentsChart").getContext("2d");
var data = {
labels: [
... | |
Change the version number from 1.1.0 to 1.2.0 | /*
* ******************************************************************************
* Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is loc... | /*
* ******************************************************************************
* Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is loc... |
Add cake script for components | #addin "Cake.Xamarin"
var username = Argument("XamarinLicenseUser", "");
var password = Argument("XamarinLicensePassword", "");
var TARGET = Argument ("target", Argument ("t", "Default"));
Task ("Default").Does (() =>
{
RestoreComponents ("./MyTrips.sln", new XamarinComponentRestoreSettings
{
Email = username,
... | |
Add misssing file from previous checkin | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class CrossHierarchyCut
{
}
}
| |
Define a mapping of well-known storage names to impls | using System;
using System.Collections.Generic;
namespace Zyborg.Vault.Server.Storage
{
public static class Standard
{
public static readonly IReadOnlyDictionary<string, Type> StorageTypes =
new Dictionary<string, Type>
{
["in-memory"] = typeof(InMemo... | |
Test that asserts all characters can be displayed properly | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
namespace CSharpMath.Rendering.Tests {
using BackEnd;
public class TestCommandDisplay {
public TestCommandDisplay() =>
typefaces = Fonts.GlobalTypefaces.ToArray();
readonly Typography.OpenFont.Typeface[... | |
Add StringBuilder extensions to accept a StringSlice | // Copyright (c) Alexandre Mutel. All rights reserved.
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.
using System.Text;
namespace Markdig.Helpers
{
/// <summary>
/// Extensions for StringBuilder with <see cref="StringSlice"/>
... | |
Add RFC 7748 test vectors | using System;
using NSec.Cryptography;
using Xunit;
namespace NSec.Tests.Rfc
{
public static class X25519Tests
{
public static readonly TheoryData<string, string, string> Rfc7748TestVectors = new TheoryData<string, string, string>
{
{ "a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a1... | |
Test illustrating a way to find the composed character sequences. They are the indexes missing from the array. | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace CSharpMath.Tests {
public class ComposedCharacterTests {
[Fact]
public void TestCharacterRanges() {
string foo = "\u0104\u0... | |
Change name to match what's being tested | using System.Text;
using Sodium;
using NUnit.Framework;
namespace Tests
{
/// <summary>
/// Tests for Random Bytes support
/// </summary>
[TestFixture]
public class RandomBytesTest
{
/// <summary>
/// Does SodiumCore.GetRandomBytes() return something
/// </summary>
[Test]
public void G... | using System.Text;
using Sodium;
using NUnit.Framework;
namespace Tests
{
/// <summary>
/// Tests for Random Bytes support
/// </summary>
[TestFixture]
public class RandomBytesTest
{
/// <summary>
/// Does SodiumCore.GetRandomBytes() return something
/// </summary>
[Test]
public void G... |
Add failing test for editor gameplay test using wrong ruleset | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using NUnit.Framework;
using osu.Framework.Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Extensions.ObjectExten... | |
Fix join-path tests on Unix. | // Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
using NUnit.Framework;
using System;
namespace TestHost.Cmdlets
{
[TestFixture]
public class JoinPathTests
{
[Test]
public void OneParentFolderAndChildFolder()
{
string resul... | // Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
using NUnit.Framework;
using System;
namespace TestHost.Cmdlets
{
[TestFixture]
public class JoinPathTests
{
[Test]
[Platform("Win")]
public void OneParentFolderAndChildFolderUnderWindow... |
Add a (disabled by default) map loading test for Generals | using System.Linq;
using OpenSage.Data;
using OpenSage.Mods.Generals;
using OpenSage.Tests.Data;
using Veldrid;
using Xunit;
using Xunit.Abstractions;
namespace OpenSage.Tests.Content
{
public class LoadMapsTests
{
private readonly ITestOutputHelper _testOutputHelper;
public LoadMapsTests(ITe... | |
Add failing tests for coverage of `GetDisplayString()` | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using Moq;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Extensions;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
using osu.Gam... | |
Add simple use integration tests | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using RawRabbit.Client;
using RawRabbit.IntegrationTests.TestMessages;
using Xunit;
namespace RawRabbit.IntegrationTests.SimpleUse
{
public class PublishAndSubscribeTests : IntegrationTestBase
{
public override void D... | |
Add an optimization test problem to check the implementation of the differential evolution algorithm. | using ISAAR.MSolve.Analyzers.Optimization;
using ISAAR.MSolve.Analyzers.Optimization.Algorithms;
using ISAAR.MSolve.SamplesConsole.Optimization.BenchmarkFunctions;
using System;
namespace ISAAR.MSolve.SamplesConsole.Optimization
{
public class OptimizationTest
{
public static void Main()
{
... | |
Fix test - explicitly set the NancyBootstrapperLocator.Bootstrapper | namespace Nancy.Tests.Unit
{
using Nancy.Owin;
using Xunit;
public class NancyOptionsFixture
{
private readonly NancyOptions nancyOptions;
public NancyOptionsFixture()
{
this.nancyOptions = new NancyOptions();
}
[Fact]
publi... | namespace Nancy.Tests.Unit
{
using Nancy.Bootstrapper;
using Nancy.Owin;
using Xunit;
public class NancyOptionsFixture
{
private readonly NancyOptions nancyOptions;
public NancyOptionsFixture()
{
this.nancyOptions = new NancyOptions();
}
... |
Add extension method to handle cases of fire-and-forget async usage | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Threading.Tasks;
using osu.Framework.Logging;
namespace osu.Game.Extensions
{
public static class TaskExtensions
{
/// <summary>
///... | |
Support for calculating odd length Fletcher checksums. | using System.Diagnostics;
namespace BTDB.Buffer
{
public static class Checksum
{
public static uint CalcFletcher32(byte[] data, uint position, uint length)
{
Debug.Assert((length & 1) == 0);
length >>= 1;
uint sum1 = 0xffff;
uint sum2 = 0xffff;
... | using System.Diagnostics;
namespace BTDB.Buffer
{
public static class Checksum
{
public static uint CalcFletcher32(byte[] data, uint position, uint length)
{
var odd = (length & 1) != 0;
length >>= 1;
uint sum1 = 0xffff;
uint sum2 = 0xffff;
... |
Create red card by country method | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using RedCard.API.Contexts;
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
namespace RedCard.API.Controllers
{
[Route("... | |
Add partial classes for legacy retry filters. | // Copyright 2019 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | |
Add custom combo list item | using System.Windows.Controls;
namespace food_tracker {
public class FoodComboItem : ComboBoxItem {
public double calories { get; set; }
public double fats { get; set; }
public double saturatedFat { get; set; }
public double carbohydrates { get; set; }
public double sugar ... | |
Add Fixed Provider for RequestHandling | using System.Collections.Generic;
using System.Linq;
namespace Glimpse.Web
{
public class FixedRequestHandlerProvider : IRequestHandlerProvider
{
public FixedRequestHandlerProvider()
: this(Enumerable.Empty<IRequestHandler>())
{
}
public FixedRequestHandlerProvider... | |
Add too many players exception | // TooManyPlayersException.cs
// <copyright file="TooManyPlayersException.cs"> This code is protected under the MIT License. </copyright>
using System;
namespace Tron.Exceptions
{
/// <summary>
/// An exception thrown when too many players are in the game.
/// </summary>
public class TooManyPlayersExc... | |
Add hosting startup to SpaFallback | using Hellang.Middleware.SpaFallback;
using Microsoft.AspNetCore.Hosting;
[assembly: HostingStartup(typeof(SpaFallbackHostingStartup))]
namespace Hellang.Middleware.SpaFallback
{
public class SpaFallbackHostingStartup : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
... | |
Remove duplicates from sorted array II | using System;
static class Program {
static int RemoveDupes(this int[] a) {
int write = 1;
int read = 0;
bool same = false;
int count = 0;
for (int i = 1; i < a.Length; i++) {
read = i;
if (same && a[read] == a[write]) {
count... | |
Add unit tests for RefundClient to make sure the query parameter works as expected | using Mollie.Api.Client;
using NUnit.Framework;
using System.Net.Http;
using System.Threading.Tasks;
namespace Mollie.Tests.Unit.Client {
[TestFixture]
public class RefundClientTests : BaseClientTests {
public const string defaultGetRefundResponse = @"{
""resource"": ""refund"",
""id"": ""re_4... | |
Add known runtime names for .NET core. | namespace AsmResolver.DotNet
{
/// <summary>
/// Provides strings of known runtime names used in .NET Core, .NET 5.0 and later.
/// </summary>
public static class KnownRuntimeNames
{
/// <summary>
/// Indicates an application targeting the default .NET Core runtime.
/// </sum... | |
Add missing test for PG object metadata | using Marten.Testing.Documents;
using Marten.Util;
using Xunit;
namespace Marten.Testing.Schema
{
public class add_origin_Tests
{
[Fact]
public void origin_is_added_to_tables()
{
var user1 = new User { FirstName = "Jeremy" };
var user2 = new User { FirstNam... | |
Add Thread Queue Size Setting | using Hudl.FFmpeg.Attributes;
using Hudl.FFmpeg.Enums;
using Hudl.FFmpeg.Resources.BaseTypes;
using Hudl.FFmpeg.Settings.Attributes;
using Hudl.FFmpeg.Settings.Interfaces;
namespace Hudl.FFmpeg.Settings
{
/// <summary>
/// This option sets the maximum number of queued packets when reading from the file or... | |
Move database interactions into repository. This contains the actions for both days and items. | using System.Collections.Generic;
using System.Linq;
namespace food_tracker.Repository {
public class NutritionRepository {
private readonly IMyEntitiesContext _db = null;
public NutritionRepository(IMyEntitiesContext db) {
_db = db;
}
public WholeDay GetDay(string i... | |
Remove TFM requirement from API | // 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 more information.
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Visu... | // 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 more information.
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Visu... |
Fix FindByAccessibilityId bug where you were not to find a subelement of an element in a dom | using System.Collections.ObjectModel;
namespace OpenQA.Selenium.Appium.Interfaces
{
internal interface IFindByAccessibilityId
{
/// <summary>
/// Finds the first of elements that match the Accessibility Id selector supplied
/// </summary>
/// <param name="selector">an Accessibi... | |
Move a small part of current | using System;
using Umbraco.Core.Logging;
namespace Umbraco.Core.Composing
{
/// <summary>
/// Provides a static service locator for most singletons.
/// </summary>
/// <remarks>
/// <para>This class is initialized with the container in UmbracoApplicationBase,
/// right after the container is ... | |
Fix Windows file format issues | /*
Copyright © Iain McDonald 2010-2019
This file is part of Decider.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using Decider.Csp.BaseTypes;
namespace Decider.Csp.Integer
{
public class MetaExpressionInteger : ExpressionInteger, IMetaExpression<int>
{
private read... | |
Add unit tests for HtmlTemplatePrivider | namespace Host.UnitTests.Conversion
{
using Crest.Host.Conversion;
using NUnit.Framework;
[TestFixture]
public sealed class HtmlTemplateProviderTests
{
[Test]
public void ContentLocationShouldReturnTheLocationAfterTheBodyTag()
{
var provider = new HtmlTemplatePr... | |
Add Microsoft Graph API calls | using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
namespace SampleAADV2Bot.Helpers
{
public class MeetingRoom
{
public string DisplayName { get; set; }
public string LocationEmai... | |
Add StackOverflow InteractiveWindow test for .NET Core | // 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 more information.
extern alias InteractiveHost;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;... | |
Change prefab for different categories. | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectPool : MonoBehaviour
{
[SerializeField]
private GameObject _prefab;
private Stack<GameObject> _pool;
public GameObject GetGameObject()
{
if (_pool != null)
{
if (_pool.Co... | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectPool : MonoBehaviour
{
[SerializeField]
private GameObject _prefab;
private Stack<GameObject> _pool;
public GameObject prefab
{
set {
_prefab = value;
}
}
//TODO... |
Add mania player test scene | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Mania.Tests
{
public class TestScenePlayer : PlayerTestScene
{
public TestScenePlayer()
... | |
Add code example for wiki. | using System;
using EOpt.Math.Optimization;
using EOpt.Math;
namespace Test
{
class Program
{
static void Main(string[] args)
{
Func<double[], double> func = (x) => 20 + (x[0] * x[0] - 10 * Math.Cos(2 * Math.PI * x[0])) +
(x[1] * x[1] - 10 * Math.Cos(2 * Math.PI * ... | |
Implement the longest common pattern | using System;
using Algorithms.Sorting;
namespace Algorithms.Strings.Search
{
public class LongestCommonPattern
{
public String Find(String s1, String s2)
{
int N = s1.Length;
String[] a = new String[N];
for (var i = 0; i < N; ++i)
{
... | |
Add test scene for previewing Torus alternates | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.G... | |
Load cadence constraint file to PCB-Investigator | //Synchronous template
//-----------------------------------------------------------------------------------
// PCB-Investigator Automation Script
// Created on 29.06.2016
// Autor Guenther
//
// Empty template to fill for synchronous script.
//-------------------------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.