Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix weaver project search path in Linux
using System; using System.IO; using System.Linq; public partial class Processor { public string WeaverAssemblyPath; public bool FoundWeaverProjectFile; public virtual void FindWeaverProjectFile() { GetValue(); if (WeaverAssemblyPath == null) { Logger.LogDebug("No W...
using System; using System.IO; using System.Linq; public partial class Processor { public string WeaverAssemblyPath; public bool FoundWeaverProjectFile; public virtual void FindWeaverProjectFile() { GetValue(); if (WeaverAssemblyPath == null) { Logger.LogDebug("No W...
Add interface for main character animations
 public interface IPlayerAnimator { void PlayIdleAnimation(); void PlayRunAnimation(); void PlayJumpAnimation(); void PlayAttackAnimation(); void PlayRunAttackAnimation(); void PlayJumpAttackAnimation(); bool ExitTimeReached(); }
Test matching composite type handling
// 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.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework...
Create a case insensitive expando object
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="DataReaderExtensions.cs" company="Bosbec AB"> // Copyright © Bosbec AB 2014 // </copyright> // <summary> // Defines extension methods for data readers. // </summary> // -------...
Add a new baked texure module methid to support baked texturing mesh avatars
//////////////////////////////////////////////////////////////// // // (c) 2009, 2010 Careminster Limited and Melanie Thielker // // All rights reserved // using System; using Nini.Config; using OpenSim.Framework; using OpenMetaverse; namespace OpenSim.Services.Interfaces { public interface IBakedTextureModule ...
//////////////////////////////////////////////////////////////// // // (c) 2009, 2010 Careminster Limited and Melanie Thielker // // All rights reserved // using System; using Nini.Config; using OpenSim.Framework; using OpenMetaverse; namespace OpenSim.Services.Interfaces { public interface IBakedTextureModule ...
Add first attempt of the Git unit tests
using System; using System.IO; using Ionic.Zip; using NUnit.Framework; namespace MSBuild.Version.Tasks.Tests { [TestFixture] public class GitVersionFileTest { [SetUp] public void SetUp() { // extract the repositories in the 'Git.zip' file into the 'temp' folder ...
Add tracingheader for support Diagnostics
// Copyright (c) .NET Core Community. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System.Collections; using System.Collections.Generic; using System.Linq; namespace DotNetCore.CAP.Diagnostics { public class TracingHeaders : IEnumerabl...
Add unit test for SecurityKeyEntropyMode.
// 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.ServiceModel.Security; using Infrastructure.Common; using Xunit; public static class SecurityKeyEntr...
Add failing test coverage of loading with an unavailable 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.IO; using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Platform; using osu.Game.Rulesets; using osu.Game.Tests; namespace osu.Game.T...
Add an ad-hoc way to provide dependency to children
// 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.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; namespace osu.Game.Tests.Visual { /// <summary> /// A <...
Add tests for new extensionmethods
using Contentful.Core.Extensions; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Text; using Xunit; namespace Contentful.Core.Tests.Extensions { public class JTokenExtensionsTests { [Fact] public void JTokenIsNullShouldReturnTrueForNullValue() ...
Add collection to array Newtonsoft.Json based JSON converter
using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; namespace Marten.Util { /// <summary> /// Serialize collection type property to JSON array using a custom Newtonsoft.Json JsonConverter /// Note that without using custom `JsonConverter`, `Newtonsoft.Json` stores it a...
Fix visibility of internal extensions type
// 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.Diagnostics; namespace System.Net.Sockets { public static class IPAddressExtensions { ...
// 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.Diagnostics; namespace System.Net.Sockets { internal static class IPAddressExtensions { ...
Add Chat View - omitted before
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Michelangelo Web Chat</title> <link href='http://fonts.googleapis.com/css?family=Yesteryear' rel='stylesheet' type='text/css'/> <script src="~/Scripts/jquery-2.0.3.js"></script> <script src="~/Scripts/http-requester.js"></s...
Add test for temporary directory
using System.IO; using System.Linq; using System.Threading.Tasks; using Xunit; namespace Meziantou.Framework.Tests { public class TemporaryDirectoryTests { [Fact] public void CreateInParallel() { const int Iterations = 100; var dirs = new TemporaryDirectory[Iter...
Add helper class used to deserialize JSON.
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; namespace WundergroundClient.Autocomplete { [DataContract] internal class RawAutocompleteResult { [DataMember] internal RawResult[] RESULTS; } [DataContract] inter...
Add the interface for the map manager
using System; using System.Collections.Generic; namespace FierceGalaxyInterface.MapModule { /// <summary> /// The MapManager load/save the map from/to the disk /// </summary> public interface IMapManager { IList<String> MapsName { get; } IReadOnlyMap LoadMap(String mapName...
Add stress test of EventHandler
using System; #if NUNIT using NUnit.Framework; using TestClassAttribute = NUnit.Framework.TestFixtureAttribute; using TestMethodAttribute = NUnit.Framework.TestCaseAttribute; #else using Microsoft.VisualStudio.TestTools.UnitTesting; #endif using Ooui; using System.Linq; using System.Threading.Tasks; using System.Dia...
Add file missing in build
using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System; using System.Collections.Generic; namespace NUnit.VisualStudio.TestAdapter.Tests { class FakeTestExecutionRecorder : IT...
Add Test to check GaugeLogMetrics log number of Rejections correctly
using System; using Hudl.Mjolnir.Events; using Hudl.Mjolnir.External; using Moq; using Xunit; namespace Hudl.Mjolnir.Tests.Events { public class GaugeLogMetricsTests { [Fact] public void RejectionsLoggedInGaugeCorrectly() { var mockLogFactory = new Mock<IMjolnirLogFactory>()...
Fix typo in the documentation
using System; using SampSharp.GameMode.World; namespace SampSharp.GameMode.SAMP.Commands { /// <summary> /// A Permission checker is used to check if a player /// is allowed to use a specific command. /// /// Every class that implement this interface /// should create paramete...
using System; using SampSharp.GameMode.World; namespace SampSharp.GameMode.SAMP.Commands { /// <summary> /// A Permission checker is used to check if a player /// is allowed to use a specific command. /// /// Every class that implement this interface /// should have a paramete...
Add gestione eccezioni servizi esterni
using System; using System.Collections.Generic; using System.Text; namespace SO115App.Models.Classi.Condivise { public class LogException { public DateTime DataOraEsecuzione { get; set; } public string Servizio { get; set; } public string Content { get; set; } public string Res...
Add missing test coverage over UnableToGenerateValueException
using System; using Xunit; namespace Peddler { public class UnableToGenerateValueExceptionTests { [Fact] public void WithDefaults() { // Act var exception = Throw<UnableToGenerateValueException>( () => { throw new UnableToGenerateValueException(); } ...
Implement KTH API data fetcher
using Newtonsoft.Json; using Org.Json; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; using System.Runtime.Serialization.Json; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Schedut...
Add tests for restoring the aggregate from events
using FluentAssertions; using NetCoreCqrsEsSample.Domain.Models; using Xunit; namespace NetCoreCqrsEsSample.Tests.Domain { public class AggregateTests { [Fact] public void Should_load_aggregate_from_events_correctly() { // arrange var counter = new Counter(); ...
Add failing test case due to div by zero
// 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.Testing; using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; us...
Add visual and assertive test coverage
// 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.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework....
Create List.Head() and List.Tail() extension methods
using System.Collections.Generic; using System.Linq; namespace squirrel { public static class ExtensionMethods { public static T Head<T>(this List<T> list) { return list[0]; } public static List<T> Tail<T>(this List<T> list) { return list.Skip(1...
Add in-process DB ORM test
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataAccessExamples.Core.Data; using DataAccessExamples.Core.Services.Department; using DataAccessExamples.Core.Services.Employee; using DataAccessExamples.Core.ViewModels; using NUnit.Fram...
Add test scene for beatmapset online status pill 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 System; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using ...
Add default ignored request provider which discovers instances
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.Remoting.Messaging; namespace Glimpse.Agent.Web.Options { public class DefaultIgnoredRequestProvider : IIgnoredRequestProvider { private readonly ITypeService _typeService; public ...
Add report with basic metadata
using KenticoInspector.Core; using KenticoInspector.Core.Constants; using KenticoInspector.Core.Models; using System; using System.Collections.Generic; using System.Text; namespace KenticoInspector.Reports.ContentTreeConsistencyAnalysis { class Report : IReport { public string Codename => "Content-Tre...
Add test for init-only properties.
using Xunit; #if NET5_0 namespace Autofac.Test.Core { public class PropertyInjectionInitOnlyTests { public class HasInitOnlyProperties { public string InjectedString { get; init; } } [Fact] public void CanInjectInitOnlyProperties() { va...
Remove the ActiveIssue(5555) tag for OSX
// 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.Net.Sockets; using System.Net.Tests; using System.Security.Cryptography.X509Certificates; using System....
// 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.Net.Sockets; using System.Net.Tests; using System.Security.Cryptography.X509Certificates; using System....
Create a class to parse the alis configuration node.
using System; using System.Collections; using System.Collections.Generic; using System.Xml; namespace Nohros.Configuration { internal class ProviderAliasesNode { public static ICollection<string> Parse(XmlElement element) { List<string> aliases = new List<string>(element.ChildNodes.Count); ...
Add tests for sqlite check constraints.
using System; using NUnit.Framework; using Moq; using SJP.Schematic.Core; namespace SJP.Schematic.Sqlite.Tests { [TestFixture] internal class SqliteCheckConstraintTests { [Test] public void Ctor_GivenNullTable_ThrowsArgumentNullException() { Assert.Throws<ArgumentNullEx...
Add acceptance tests for feature prerequisites
using System.Threading.Tasks; using NServiceBus; using NServiceBus.AcceptanceTesting; using NServiceBus.AcceptanceTests.EndpointTemplates; using NServiceBus.Features; using NServiceBus.Settings; using NUnit.Framework; [TestFixture] class When_notifications_are_misconfigured { [Test] public async Task Should_n...
Add a interface for the NTP time module
using System; namespace FierceGalaxyInterface.TimeModule { public interface NetworkTime { /// <summary> /// Return the time from a default NTP server /// </summary> DateTime GetNetworkTime(); /// <summary> /// Return the time from the given NTP server /...
Add temporary workaround to load annotations
using System; using System.Collections.Generic; using JetBrains.Application; using JetBrains.Metadata.Utils; using JetBrains.ReSharper.Psi.ExtensionsAPI.ExternalAnnotations; using JetBrains.Util; namespace JetBrains.ReSharper.Plugins.Unity.Rider { // Temporary workaround for RIDER-13547 [ShellComponent] p...
Add fixed ignored request provider to allow user full controll
using System.Collections.Generic; using System.Linq; namespace Glimpse.Agent.Web.Options { public class FixedIgnoredRequestProvider : IIgnoredRequestProvider { public FixedIgnoredRequestProvider() : this(Enumerable.Empty<IIgnoredRequestPolicy>()) { } public FixedIg...
Add missing file to repository
// *********************************************************************** // Copyright (c) 2010 Charlie Poole // // 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, incl...
Create Soccer Lobby ball factory/manager
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using SceneJect.Common; using Sirenix.OdinInspector; using Sirenix.Serialization; using UnityEngine; namespace Booma.Proxy { /// <summary> /// Simple manager that manages the spawning and despawning t...
Add release manager command to show "lagging" packages
// 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 default provider which uses reflection
using System; using System.Collections.Generic; using System.Linq; namespace Glimpse.Web { public class DefaultRequestAuthorizerProvider : IRequestAuthorizerProvider { private readonly ITypeService _typeService; public DefaultRequestAuthorizerProvider(ITypeService typeService) { ...
Create polygon out of selectet lines and arcs
//----------------------------------------------------------------------------------- // PCB-Investigator Automation Script // Created on 2014-04-24 // Autor support@easylogix.de // www.pcb-investigator.com // SDK online reference http://www.pcb-investigator.com/sites/default/files/documents/InterfaceDocumentation...
Add test coverage of score importing
// 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.Screens; using osu.Framework.Testing; using osu.Game.Rulesets; using osu.Game.Rulesets.Objects; using osu.Ga...
Create User Module Ninject Commit
using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using NeedDotNet.Server.Domain.Entities; using NeedDotNet.Web.Infrastructure; using NeedDotNet.Web.Services; using Ninject.Modules; using Ninject.Web.Common; namespace NeedDotNet.Web.NinjectResolution { internal class UserIdentityMod...
Check emptyness of an XDocument
using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace GranitXMLEditor { public static class XDocumentExtension { public static bool IsEmpty(this XDocument element) { ret...
Allow scenario class to take properties
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) { ...
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...
Add failing test showing the issue of DHO lifetime
// 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.Testing; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Tests.Visual; namespace os...
Create tests for grouped filters
using SqlKata.Compilers; using SqlKata.Tests.Infrastructure; using Xunit; namespace SqlKata.Tests { public class WhereTests : TestSupport { [Fact] public void GroupedWhereFilters() { var q = new Query("Table1") .Where(q => q.Or().Where("Column1", 10).Or().Whe...
Add base class for all realtime multiplayer classes
// 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 JetBrains.Annotations; using osu.Framework.Allocation; using osu.Game.Online.RealtimeMultiplayer; namespace osu.Game.Screens.Multi.RealtimeMultiplayer { public...
Remove NumPages, Total, and LastPageUri from ListBase
using System; using System.Collections.Generic; namespace Twilio { /// <summary> /// Base class for list resource data /// </summary> public class TwilioListBase : TwilioBase { /// <summary> /// The current page number. Zero-indexed, so the first page is 0. /// </summary> public int Page { get; set; } /...
using System; using System.Collections.Generic; namespace Twilio { /// <summary> /// Base class for list resource data /// </summary> public class TwilioListBase : TwilioBase { /// <summary> /// The current page number. Zero-indexed, so the first page is 0. /// </summary> public int Page { get; set; } /...
Add missing enum for wood.
namespace Decent.Minecraft.Client { public enum Orientation : ushort { UpDown = 0x0, EastWest = 0x4, NorthSouth = 0x8, None = 0xC } }
Add some test coverage for Ensure
using System; using Burr.Helpers; using FluentAssertions; using Xunit; using Xunit.Extensions; namespace Burr.Tests.Helpers { public class EnsureTests { public class TheArgumentNotNullMethod { [Fact] public void ThrowsForNullArgument() { var ...
Add an infraction search command
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Discord; using Discord.Commands; using Discord.WebSocket; using Modix.Data.Models; using Modix.Data.Models.Moderation; using Modix.Services.Moderation; using Serilog; using Tababular; namespace Mo...
Add swuber icon to gmaps marker and switch views to satelite
 @{ ViewBag.Title = "UserDashBoard"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>UserDashBoard</h2> <fieldset> @if (Session["NNumber"] != null) { <text> Welcome @Session["NNumber"].ToString() @Session["FirstName"].ToString() @Session["LastName"].ToString() </text> } </fieldset> <h2...
Add partial class for retry settings (compatibility)
// 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 integration tests for Empiria Oracle Data Handler and Empiria ORM
/* Empiria Extensions **************************************************************************************** * * * Module : Oracle Data Handler Component : Test Helpers ...
Move extensions to appropriate project
using System; namespace Grobid.PdfToXml { public static class Extensions { // Same rules as pdftoxml. // Max difference in primary font sizes on two lines in the same // block. Delta1 is used when examining new lines above and below the // current block. pr...
Add some sample console output
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplicationSample { class Program { static void Main(string[] args) { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplicationSample { class Program { static void Main(string[] args) { Console.WriteLine("Changeset: " + VersionInfo.Changeset); C...
Add test scene for hitcircles and combo changes
// 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.Bindables; using osu.Game.Rulesets.Osu.Objects; namespace osu.Game.Rulesets.Osu.Tests { public class TestSceneHitCircleComboChange : TestSceneHit...
Add basic multiplayer gameplay test coverage
// 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.Game.Screens.OnlinePlay.Multiplayer; namespace osu.Game.Tests.Visual.Multiplayer { public class TestMultiplayerGa...
Add Storage function unit 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 entry point. Technically not really needed, but fixes a ReSharper warning.
using System; namespace HelloCoreClrApp.Test { public static class Program { // Entry point for the application. public static void Main(string[] args) { Console.WriteLine("Please use 'dotnet test' or 'dotnet xunit' to run unit tests."); } } }
Add missing file (to b7f3a06 and later)
// // UniversityPortalConfig.cs // // Author: // Roman M. Yagodin <roman.yagodin@gmail.com> // // Copyright (c) 2016 Roman M. Yagodin // // 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 Softw...
Implement show-version command referred to in PROCESSES.md
// 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...
TEST Transaction: no DB connection if not needed, possible to pass DB connection.
// // Copyright (c) 2014 Piotr Fusik <piotr@fusik.info> // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of source code must retain the above copyri...
Test that the container can resolve Test that the container can resolve the engine root object Having this test would have saved some time recently
using System; using NuKeeper.Configuration; using NuKeeper.Engine; using NUnit.Framework; namespace NuKeeper.Tests { [TestFixture] public class ContainerRegistrationTests { [Test] public void RootCanBeResolved() { var container = ContainerRegistration.Init(MakeValidSett...
Add default implementation for RequestProfilers provider
using System; using System.Collections.Generic; using System.Linq; namespace Glimpse.Agent.Web { public class DefaultRequestProfilerProvider : IRequestProfilerProvider { private readonly ITypeService _typeService; public DefaultRequestProfilerProvider(ITypeService typeService) { ...
Add failing test for assertion of concurrent calls
namespace FakeItEasy.Tests { using System.Threading; using System.Threading.Tasks; using FluentAssertions; using Xunit; using Xunit.Abstractions; public class ConcurrentCallTests { private readonly ITestOutputHelper output; public ConcurrentCallTests(ITestOutput...
Add tests for the ValidatorFixtureAttribute
using NUnit.Framework; using System; using System.Reflection; namespace NValidate.Tests { [TestFixture] public class ValidatorFixtureAttributeTest { [ValidatorFixture("WithAttribute")] class ClassWithAttribute { } class ClassWithoutAttribute { } [Test] ...
Include DTO pretty printer extensions
using System; using System.Text; namespace CIAPI { ///<summary> /// Useful logging and debugging extensions ///</summary> public static class PrettyPrinterExtensions { ///<summary> /// Create string showing values of all public properties for object ///</summary> //...
Add new tests for Choose Function
using System; using System.IO; using EPPlusTest.FormulaParsing.TestHelpers; using Microsoft.VisualStudio.TestTools.UnitTesting; using OfficeOpenXml; using OfficeOpenXml.FormulaParsing; using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; using OfficeOpenXml.FormulaParsing.Exceptions; namespace EP...
Add a benchmark case for affects render.
using Avalonia.Controls; using Avalonia.Media; using BenchmarkDotNet.Attributes; namespace Avalonia.Benchmarks.Visuals; [MemoryDiagnoser] public class VisualAffectsRenderBenchmarks { private readonly TestVisual _target; private readonly IPen _pen; public VisualAffectsRenderBenchmarks() { ...
Add tests for anonymous object rendering.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ExpressionToCodeLib; using Xunit; namespace ExpressionToCodeTest { public class AnonymousObjectFormattingTest { [Fact] public void AnonymousObjectsRenderAsCode...
Change SafePipeHandle to use IntPtr.Zero instead of new IntPtr(0)
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.InteropServices; using System.Security; namespace Microsoft.Win32.SafeHandles { public sealed partial class SafePipeHandle : Saf...
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.InteropServices; using System.Security; namespace Microsoft.Win32.SafeHandles { public sealed partial class SafePipeHandle : Saf...
Allow for types with no namespaces
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace FluentMigrator.Runner { /// <summary> /// Advanced searching and filtration of types collections. /// </summary> static class TypeFinder { /// <summary> /// Searches for types loca...
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace FluentMigrator.Runner { /// <summary> /// Advanced searching and filtration of types collections. /// </summary> static class TypeFinder { /// <summary> /// Searches for types loca...
Add windowing subsystem hookup for reflection UsePlatformDetect.
using Avalonia.MonoMac; using Avalonia.Platform; [assembly: ExportWindowingSubsystem(OperatingSystemType.OSX, 1, "MonoMac", typeof(MonoMacPlatform), nameof(MonoMacPlatform.Initialize))]
Add unit tests for DefaultSwaggerTagCatalog
using FakeItEasy; using Nancy.Swagger.Services; using Swagger.ObjectModel; using System.Collections.Generic; using Xunit; namespace Nancy.Swagger.Tests.Services { public class DefaultSwaggerTagCatalogTest { private DefaultSwaggerTagCatalog _defaultSwaggerTagCatalog; public DefaultSwaggerTagCa...
Add new [LinkerSafe] attribute - which tells the linker (when enabled) that an assembly is safe to link (even if Link All is not used)
// // Copyright 2013 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, copy, modify, merge, publish, /...
Add an instant progress bar extension method
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace DarkUI.Extensions { // https://stackoverflow.com/questions/6071626/progressbar-is-slow-in-windows-forms public static class ExtensionMethods { /// <summary> /// Sets ...
Add unit tests for the SqliteAnchorBuilder class
// Copyright 2015 Coinprism, Inc. // // 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
Convert a binary to decimal value
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BinaryToDecimal { class Program { static void Main(string[] args) { //Problem //Convert a binary n to its decimal value //Solution ...
Add tests for Sha256 class
using System; using NSec.Cryptography; using Xunit; namespace NSec.Tests.Algorithms { public static class Sha256Tests { public static readonly string HashOfEmpty = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; [Fact] public static void HashEmpty() { ...
Add very simple stacking test
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.IO; using System.Linq; using System.Text; using NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Tests.Beatmaps...
Change wording on first shiney collect
using System; using UnityEngine; using System.Collections; using System.Collections.Generic; public class ItemSpawn : MonoBehaviour { public string Guid; public static List<string> CollectedList = new List<string>(); public GameObject Shiney; public CollectableType ShineyType; private GuiCanvas...
using System; using UnityEngine; using System.Collections; using System.Collections.Generic; public class ItemSpawn : MonoBehaviour { public string Guid; public static List<string> CollectedList = new List<string>(); public GameObject Shiney; public CollectableType ShineyType; private GuiCanvas...
Add test coverage of beat snapping hit circles
// 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.Testing; using osu.Game.Beatmaps; using osu.Game.Rulesets.Osu.UI; using osu.Game.Tests.Beatmaps; using osuTK...
Add a test for projection collection
using Sakuno.Collections; using System.Collections.ObjectModel; using Xunit; namespace Sakuno.Base.Tests { public static class ProjectionCollectionTests { [Fact] public static void SimpleProjection() { var source = new ObservableCollection<int>(); var projection...
Add test coverage for song select footer area
// 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.Graphics; using osu.Game.Screens.Select; namespace osu.Game.Tests.Visual.SongSelect { public class TestSceneSongSelectFooter : OsuManualInputMana...
Fix startup error - setup root view controller
using UIKit; using Foundation; namespace MonoCatalog { // The name AppDelegate is referenced in the MainWindow.xib file. public partial class AppDelegate : UIApplicationDelegate { // This method is invoked when the application is ready to run // public override bool FinishedLaunching (UIApplication ...
using UIKit; using Foundation; namespace MonoCatalog { // The name AppDelegate is referenced in the MainWindow.xib file. public partial class AppDelegate : UIApplicationDelegate { // This method is invoked when the application is ready to run // public override bool FinishedLaunching (UIApplication ...
Add sample code in place of Hangman
using System; public class Hangman { public static void Main(string[] args) { Console.WriteLine("Hello, World!"); Console.WriteLine("You entered the following {0} command line arguments:", args.Length ); for (int i=0; i < args.Length; i++) { Console.WriteLine("{0}", args[i]); } } }
Add ${aspnet-traceidentifier} (ASP.NET Core only)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NLog.LayoutRenderers; namespace NLog.Web.LayoutRenderers { /// <summary> /// Print the TraceIdentifier /// </summary> /// <remarks>.NET Core Only</remarks> [LayoutRenderer("asp...
Add HTML control so you can add raw html to your layouts
using WootzJs.Web; namespace WootzJs.Mvc.Mvc.Views { public class Html : Control { private string html; public Html(string html) { this.html = html; } protected override Element CreateNode() { var result = Browser.Document.CreateElement...
Add tests for wrapping routine provider for Oracle.
using System; using NUnit.Framework; using Moq; using SJP.Schematic.Core; using System.Data; namespace SJP.Schematic.Oracle.Tests { [TestFixture] internal static class OracleDatabaseRoutineProviderTests { [Test] public static void Ctor_GivenNullConnection_ThrowsArgNullException() {...
Add extra checks around the trusting of the value in the file. By default we wont pull over anything invalid and log out when something is wroung.
using System; using System.Configuration; using System.IO; using ZocMonLib; namespace ZocMonLib { public class RecordReduceStatusSourceProviderFile : RecordReduceStatusSourceProvider { private readonly ISystemLogger _logger; private readonly string _reducingStatusTxt = ConfigurationManager.AppS...
using System; using System.Configuration; using System.IO; using ZocMonLib; namespace ZocMonLib { public class RecordReduceStatusSourceProviderFile : RecordReduceStatusSourceProvider { private readonly ISystemLogger _logger; private readonly string _reducingStatusTxt = ConfigurationManager.AppS...
Add missing project installer file
namespace Fr.Lakitrid.DomoCore { partial class ProjectInstaller { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary...
Add a logout IT class
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; using FluentAssertions; using Newtonsoft.Json; using Stormpath.SDK.Account; using Stormpath.SDK.Client; using Stormpath.SDK.Resource; using Xunit; namespac...
Use correct assembly to retrieve ProdInfo
using System; using System.Reflection; namespace NMaier.SimpleDlna.Utilities { public static class ProductInformation { public static string Company { get { var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); if (attribu...
using System; using System.Reflection; namespace NMaier.SimpleDlna.Utilities { public static class ProductInformation { public static string Company { get { var attributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); if (attributes....
Add proper error handling for IO errors.
namespace dotless.Core { using System.IO.Compression; using System.Web; using configuration; using Microsoft.Practices.ServiceLocation; public class LessCssHttpHandler : IHttpHandler { public IServiceLocator Container { get; set; } public DotlessConfiguration Config { get; set;...
namespace dotless.Core { using System.IO.Compression; using System.Web; using configuration; using Microsoft.Practices.ServiceLocation; public class LessCssHttpHandler : IHttpHandler { public IServiceLocator Container { get; set; } public DotlessConfiguration Config { get; set;...