Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Make Activity Serializable on NET 4.5 since it's stored in CallContext | // 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.Runtime.Remoting.Messaging;
using System.Security;
using System.Threading;
namespace System.Diagnostic... | // 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.Runtime.Remoting.Messaging;
using System.Security;
using System.Threading;
namespace System.Diagnostic... |
Set name for Avalonia thread to identify it more easily in debugger. | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using Avalonia;
using Avalonia.Logging.Serilog;
namespace Infusion.Desktop
{
/// <summary>
/// Interaction logic for App... | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using Avalonia;
using Avalonia.Logging.Serilog;
namespace Infusion.Desktop
{
/// <summary>
/// Interaction logic for App... |
Implement room exists data contract | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Schedutalk.Logic.KTHPlaces
{
[DataContract]
public class RoomDataContract
{
[DataMember(Name = "floorUid")]
public string FloorU... | |
Add test coverage of nested game 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;
using NUnit.Framework;
using osu.Framework.Testing;
namespace osu.Framework.Tests.Visual.Testing
{
public class TestSceneNestedGame : FrameworkTestSce... | |
Test to verify compiled query error was addressed in v4 changes. Closes GH-784 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Marten.Linq;
using Marten.Testing.Documents;
using Marten.Testing.Harness;
using Shouldly;
using Xunit;
using Xunit.Abstractions;
namespace Marten.Testing.Bugs
{
public class Bug_784_Collection_Contains_within_c... | |
Verify that an exception is thrown when more than one type matches | using System;
using System.Collections.Generic;
using Xunit;
using Xunit.Extensions;
namespace AppHarbor.Tests
{
public class TypeNameMatcherTest
{
interface IFoo
{
}
class Foo : IFoo { }
private static Type FooType = typeof(Foo);
[Fact]
public void ShouldThrowIfInitializedWithUnnasignableType()
... | using System;
using System.Collections.Generic;
using Xunit;
using Xunit.Extensions;
namespace AppHarbor.Tests
{
public class TypeNameMatcherTest
{
interface IFoo
{
}
class Foo : IFoo { }
private static Type FooType = typeof(Foo);
[Fact]
public void ShouldThrowIfInitializedWithUnnasignableType()
... |
Remove the nullable disable annotation in the testing beatmap and mark some of the properties as nullable. | // 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.
#nullable disable
using System.IO;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics.Textures;
using osu.Game.Beatmaps;
using osu... | // 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 osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics.Textures;
using osu.Game.Beatmaps;
using osu.Game.Skinning;
usi... |
Add a level script that can trigger the ending cutscene | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuilderLevel : MonoBehaviour {
public CameraManager camera;
public void doTakeoff() {
double time = 1.5;
Vector3 pos = camera.transform.position;
pos.y += -10;
//camera.scootTo (pos, time);
camera.rotateTo (new V... | |
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... | |
Update the example to skip authentication | namespace BasicExample
{
using System;
using System.Collections.Generic;
using Crest.Abstractions;
/// <summary>
/// Shows an example of how to disable JWT authentication.
/// </summary>
public sealed class DisableJwtAuthentication : IJwtSettings
{
/// <inheritdoc />
pu... | |
Create initial attributes for attribute-driven Worksheet.FromData | using System;
namespace Simplexcel.Cells
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
internal class XlsxColumnAttribute : Attribute
{
/// <summary>
/// The name of the Column, used as the Header row
/// </summary>
... | |
Add Brandon Olin as author | using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web;
using Firehose.Web.Infrastructure;
namespace Firehose.Web.Authors
{
public class BrandonOlin : IFilterMyBlogPosts, IAmACommunityMember
{
public string FirstName => "Brandon";
... | |
Add benchmark coverage of `Scheduler` | // 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 BenchmarkDotNet.Attributes;
using osu.Framework.Threading;
namespace osu.Framework.Benchmarks
{
public class BenchmarkScheduler : BenchmarkTest
{
p... | |
Add dump PSI for file internal action | using System.Diagnostics;
using System.IO;
using System.Text;
using JetBrains.Application.DataContext;
using JetBrains.Application.UI.Actions;
using JetBrains.Application.UI.ActionsRevised.Menu;
using JetBrains.Application.UI.ActionSystem.ActionsRevised.Menu;
using JetBrains.ProjectModel;
using JetBrains.ProjectModel.D... | |
Create abstract base class for a HttpServer | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
namespace Snowflake.Core.Server
{
public abstract class BaseHttpServer
{
HttpListener serverListener;
Thread serverThread;
bool c... | |
Fix build error for XCode | using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using UnityEditor.Callbacks;
using System.Collections;
public class UpdateXcodeProject
{
[PostProcessBuildAttribute (0)]
public static void OnPostprocessBuild (BuildTarget buildTarget, string pathToBuiltProject)
{
... | |
Add helper extension methods for route data - Added RouteData.GetCurrentPage<T>() - Added RouteData.GetNavigationContext() | using System.Web;
using System.Web.Routing;
using BrickPile.Core.Routing;
namespace BrickPile.Core.Extensions
{
public static class RouteDataExtensions
{
public static T GetCurrentPage<T>(this RouteData data)
{
return (T)data.Values[PageRoute.CurrentPageKey];
}
pub... | |
Add helper to track ongoing operations in UI | // 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 osu.Framework.Bindables;
namespace osu.Game.Screens.OnlinePlay
{
/// <summary>
/// Utility class to track ongoing online operations' progress... | |
Add missing file to repository | // ***********************************************************************
// Copyright (c) 2012 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... | |
Add utility class (mapped from Java SDK) | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Alexa.NET.Request.Type;
namespace Alexa.NET.Request
{
public static class SkillRequestUtility
{
public static string GetIntentName(this SkillRequest request)
{
return request.Request is Inte... | |
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")] | |
Add API service to handle save and load of API keys | using System;
using System.Threading.Tasks;
using ReceptionKiosk.Helpers;
using Windows.Storage;
using Windows.UI.Xaml;
namespace ReceptionKiosk.Services
{
public class APISettingsService
{
private string faceAPI;
private string bingAPI;
public APISettingsService()
{
... | |
Add missing PartsDb base class | using System;
using System.Data;
using System.Collections.Generic;
public delegate void ErrorHandler(string message, Exception exception);
public delegate void PartTypesHandler(List<PartType> partTypes);
public delegate void PartsHandler(PartCollection part);
public delegate void PartHandler(Part part);
public abstr... | |
Test for async graph updates from gui block/connector | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using KSPCommEngr;
namespace CommEngrTest
{
[TestClass]
public class CommBlockTests
{
[TestMethod]
public void UpdateGraphOnDragStop()
{
Graph graph = new Graph(new int[,] {
{... | |
Add simple test case for FullscreenOverlay | // 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.Shapes;
using osu.Game.Overlays;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual.... | |
Check we don't reference DesignTime assemblies | using System.IO;
using System.Reflection;
using NUnit.Framework;
public class GitHubAssemblyTests
{
[Theory]
public void GitHub_Assembly_Should_Not_Reference_DesignTime_Assembly(string assemblyFile)
{
var asm = Assembly.LoadFrom(assemblyFile);
foreach (var referencedAssembly in asm.GetRefe... | |
Create new CelestialBody from asteroid data | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace DMModuleScienceAnimateGeneric
{
public class AsteroidScience
{
protected DMModuleScienceAnimateGeneric ModSci = FlightGlobals.ActiveVessel.FindPartModulesImplementing<DMModuleScienceAnima... | |
Add test for BinarySearcher class | using System.Collections.Generic;
using Xunit;
using Algorithms.Search;
namespace UnitTest.AlgorithmsTests
{
public static class BinarySearcherTest
{
[Fact]
public static void MergeSortTest()
{
//a list of int
IList<int> list = new List<int> {9, 3, 7, 1, 6, 10... | |
Adjust transform to look better | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
public class ShakeContainer : Container
{
... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
public class ShakeContainer : Container
{
... |
Add the support for autoscale SCPI command | using System;
using System.Collections.Generic;
using System.Text;
namespace SCPI
{
public class AUTOSCALE : ICommand
{
public string Description => "The oscilloscope will automatically adjust the vertical scale, horizontal timebase, and trigger mode according to the input signal to realize optimum wa... | |
Fix typo: Arrary --> Array | using System;
using System.Linq.Expressions;
namespace Nest.Resolvers
{
public static class Property
{
/// <summary>
/// Create a strongly typed string representation of the path to a property
/// <para>i.e p => p.Arrary.First().SubProperty.Field will return 'array.subProperty.field'</para>
/// </summary>
... | using System;
using System.Linq.Expressions;
namespace Nest.Resolvers
{
public static class Property
{
/// <summary>
/// Create a strongly typed string representation of the path to a property
/// <para>i.e p => p.Array.First().SubProperty.Field will return 'array.subProperty.field'</para>
/// </summary>
/... |
Move JobStore cleanup to abstract class. | using System;
namespace Quartz.DynamoDB.Tests.Integration.JobStore
{
/// <summary>
/// Abstract class that provides common dynamo db cleanup for JobStore integration testing.
/// </summary>
public abstract class JobStoreIntegrationTest : IDisposable
{
protected DynamoDB.JobStore _sut;
... | |
Copy source code from KLibrary-Labs | using System;
using System.Collections.Generic;
namespace KLibrary.Linq
{
public static class Comparison
{
public static IComparer<T> CreateComparer<T>(Func<T, T, int> compare)
{
return new DelegateComparer<T>(compare);
}
public static IEqualityComparer... | |
Implement testcase for room settings | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Match.Components;
namespace osu.G... | |
Add stub implementation of local | using System;
namespace Glimpse.Server
{
public class LocalBrokerPublisher : IBrokerPublisher
{
public void PublishMessage(IMessage message)
{
// TODO: push straight to the bus
}
}
} | |
Add auto exit play mode on compile | using UnityEngine;
using System.Collections;
using UnityEditor;
namespace Expanse
{
/// <summary>
/// Exits play mode automatically when Unity performs code compilation.
/// </summary>
[InitializeOnLoad]
public class ExitPlayModeOnCompile
{
private static ExitPlayModeOnCompile instance... | |
Add constant time functions and functions for generating random bytes | using System;
using System.Runtime.CompilerServices;
namespace NSec.Experimental
{
public static class CryptographicUtilities
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void FillRandomBytes(Span<byte> data)
{
System.Security.Cryptography.RandomNumberG... | |
Add new configuration for ServiceContainer | namespace TestHttpCompositionConsoleApp.ConfigurationSources
{
using System;
using Newtonsoft.Json;
using Serviceable.Objects.Composition.Graph;
using Serviceable.Objects.Composition.Graph.Stages.Configuration;
using Serviceable.Objects.Composition.Service;
using Serviceable.Objects.IO.NamedPip... | |
Add a class to perform basic vector operations (addition, subtraction, scaling) for the optimization needs. | using System;
namespace ISAAR.MSolve.Analyzers.Optimization.Commons
{
public static class VectorOperations
{
public static double[] Add(double[] v1, double[] v2)
{
CheckDimensions(v1, v2);
double[] result = new double[v1.Length];
for (int i = 0; i < v1.Le... | |
Add interface for common properties | namespace food_tracker {
public interface IListItems {
double calories { get; set; }
double amount { get; set; }
double fats { get; set; }
double saturatedFat { get; set; }
double carbohydrates { get; set; }
double sugar { get; set; }
double protein { get; se... | |
Return Dummy from unconfigured property getter | namespace FakeItEasy.Core
{
using System;
using System.Linq;
using FakeItEasy.Creation;
/// <content>Auto fake property rule.</content>
public partial class FakeManager
{
[Serializable]
private class AutoFakePropertyRule
: IFakeObjectCallRule
{
... | namespace FakeItEasy.Core
{
using System;
using System.Linq;
/// <content>Auto fake property rule.</content>
public partial class FakeManager
{
[Serializable]
private class AutoFakePropertyRule
: IFakeObjectCallRule
{
public FakeManager F... |
Add a simple debug query | using HotChocolate.Types;
using System;
using System.Collections.Generic;
using System.Text;
namespace Snowflake.Support.GraphQLFrameworkQueries.Queries.Debug
{
public class EchoQueries
: ObjectTypeExtension
{
protected override void Configure(IObjectTypeDescriptor descriptor)
{
... | |
Add keywords of the Print Schema Keywords v1.1 | using System.Xml.Linq;
namespace Kip
{
public static class Pskv11
{
public static readonly XNamespace Namespace = "http://schemas.microsoft.com/windows/2013/05/printing/printschemakeywordsv11";
public static readonly XName JobPasscode = Namespace + "JobPasscode";
public static readonl... | |
Add class to avoid byte[] creation | using System.IO;
using System.Runtime.InteropServices;
namespace Diadoc.Api.Com
{
[ComVisible(true)]
[Guid("AC96A3DD-E099-44CC-ABD5-11C303307159")]
public interface IComBytes
{
byte[] Bytes { get; set; }
void ReadFromFile(string path);
void SaveToFile(string path);
}
[ComVisible(true)]
[ProgId("Diadoc.... | |
Add generation of KML file to maps menu | using FTAnalyzer.Utilities;
using System;
namespace FTAnalyzer.Mapping
{
static class GoogleAPIKey
{
static string APIkeyValue = string.Empty;
public static string KeyValue
{
get
{
if (string.IsNullOrEmpty(APIkeyValue))
{
... | |
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 ... | |
Add model class for mod presets | // 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;
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// A mod preset is a named collection of configured mods.
/... | |
Add exception type for native call failures. | // ---------------------------------------------------------------------------------------
// <copyright file="NativeCallException.cs" company="">
// Copyright © 2015 by Adam Hellberg and Brandon Scott.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software ... | |
Add version helper to simplify creating a version list | using System;
using System.Collections.Generic;
using System.Linq;
namespace KenticoInspector.Core.Helpers
{
public class VersionHelper
{
public static IList<Version> GetVersionList(params string[] versions)
{
return versions.Select(x => GetVersionFromShortString(x)).ToList();
... | |
Add CreateGenericInstance Type extension method to help building models | using System;
namespace Zbu.ModelsBuilder
{
public static class TypeExtensions
{
/// <summary>
/// Creates a generic instance of a generic type with the proper actual type of an object.
/// </summary>
/// <param name="genericType">A generic type such as <c>Something{}</c></para... | |
Add a base for web forms controls | namespace My.AspNetCore.WebForms.Controls
{
public abstract class Control
{
public string Id { get; set; }
public string InnerHtml { get; protected set; }
public abstract void Render();
}
}
| |
Add initial contract for message bus | using System;
namespace Glimpse.Broker
{
public interface IMessageBus
{
IObservable<T> Listen<T>();
IObservable<T> ListenIncludeLatest<T>();
bool IsRegistered(Type type);
}
} | |
Add JWA enumeration for JWS Algorithms | using System.Runtime.Serialization;
namespace THNETII.Security.JOSE
{
/// <summary>
/// Defines the set of <c>"alg"</c> (algorithm) Header Parameter
/// values defined by this specification for use with JWS.
/// <para>Specified in <a href="https://tools.ietf.org/html/rfc7518#section-3.1">RFC 7518 - JS... | |
Read and write a Trie | // Print a trie
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
class Node
{
private Dictionary<char, Node> Next = new Dictionary<char, Node>();
private bool IsWord;
public static Node Read(List<String> items)
{
return items
.Aggregate(
... | |
Add sendgeneric command to TestClient to allow one to send arbitrary GenericMessagePackets to the simulator for testing purposes | using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using OpenMetaverse.Packets;
namespace OpenMetaverse.TestClient
{
/// <summary>
/// Sends a packet of type GenericMessage to the simulator.
/// </summary>
public class GenericMessageCommand : Command
{
p... | |
Add failing tests for mapping of enum values | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EntryPoint;
using Xunit;
namespace EntryPointTests {
public class EnumArguments {
[Fact]
public void Enums_Int() {
string[] args = new string[] {
"--opt-1", "3"
... | |
Remove duplicate exception clear similar link | @model StackExchange.Opserver.Views.Exceptions.ExceptionsModel
@{
var e = Model.Exception;
var log = Model.SelectedLog;
var exceptions = Model.Errors;
this.SetPageTitle(Model.Title);
}
@section head {
<script>
$(function () { Status.Exceptions.init({ log: '@log', id: '@e.GUID', enablePrevi... | @model StackExchange.Opserver.Views.Exceptions.ExceptionsModel
@{
var e = Model.Exception;
var log = Model.SelectedLog;
var exceptions = Model.Errors;
this.SetPageTitle(Model.Title);
}
@section head {
<script>
$(function () { Status.Exceptions.init({ log: '@log', id: '@e.GUID', enablePrevi... |
Add class to hold snippets for the Period type | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NodaTime.Demo
{
class PeriodDemo
{
}
}
| |
Add - Attività Utente per la gestrione degli stati "InLavorazione" e "Prenotato" | using System;
using System.Collections.Generic;
using System.Text;
namespace SO115App.Models.Classi.Soccorso
{
public class AttivitaUtente
{
public string Nominativo { get; set; }
public DateTime DataInizioAttivita { get; set; }
}
}
| |
Add simple ping controller to check functionality. | using A2BBAPI.Data;
using A2BBAPI.Models;
using A2BBCommon;
using A2BBCommon.DTO;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using static A2BBAPI.Models.InOut;
namespace A2BBAPI.Controllers
{
/// <summary>
/// C... | |
Add enumeration of supported SqlClient versions. | /*
Copyright 2021 Jeffrey Sharp
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS A... | |
Introduce a new ReleaseManager tool (populate-api-catalog) | // Copyright 2022 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 testable spectator streaming client | // 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.Collections.Generic;
using osu.Framework.Bindables;
using osu.Framework.Utils;
using osu.Game.Online;
using osu.Game.Online.Spectator;
using osu.Game.Replays... | |
Add visual test for EdgeSnappingContainer | // 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 osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osuTK;
u... | |
Add unit tests for TestId | using System.Collections.Generic;
using System.Linq;
using Arkivverket.Arkade.Core.Util;
using FluentAssertions;
using Xunit;
namespace Arkivverket.Arkade.CoreTests.Util
{
public class TestIdTests
{
[Fact]
public void ToStringTest()
{
var testId = new TestId(TestId.TestKind... | |
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... | |
Fix missing files for release 3.7.4.2704 | namespace Patagames.Pdf.Net.Controls.Wpf
{
/// <summary>
/// Represents the scaling options of the page for printing
/// </summary>
public enum PrintSizeMode
{
/// <summary>
/// Fit page
/// </summary>
Fit,
/// <summary>
/// Actual size
/// <... | |
Disable test parallelization in Marten.Testing | using Xunit;
// 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: CollectionBehavior(DisableTestParallelization = true)]
| |
Optimize coins management with CoinRegistry | using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using NBitcoin;
using WalletWasabi.Models;
namespace WalletWasabi.Gui.Models
{
public class CoinsRegistry
{
private HashSet<SmartCoin> _coins;
private object _lock;
public event NotifyCollectionChangedEventHandler Collec... | |
Add tests to cover TestSuite.Copy | using NUnit.Framework.Api;
using NUnit.TestData.OneTimeSetUpTearDownData;
using NUnit.TestData.TestFixtureSourceData;
using NUnit.TestUtilities;
namespace NUnit.Framework.Internal
{
// Tests that Copy is properly overridden for all types extending TestSuite - #3171
public class TestSuiteCopyTests
{
... | |
Create Test that dapper works wil Session | using System.Collections.Generic;
using System.Linq;
using Dapper;
using FakeItEasy;
using NUnit.Framework;
using Smooth.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Tests.TestHelpers;
using Smooth.IoC.Dapper.Repository.UnitOfWork.Data;
namespace Smooth.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Tests.ExampleTests
{
... | |
Add Win32 functionality to get foreground process | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Articulate
{
/// <summary>
/// Gets information about the currently active window
/// </summary>
public sta... | |
Add an xUnit test discoverer that ignores tests when run on AppVeyor | namespace Respawn.DatabaseTests
{
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
public class SkipOnAppVeyorTestDiscoverer : IXunitTestCaseDiscoverer
{
private readonly IMessageSink _diagnosticMessageSi... | |
Change DropDownButton, Change Sepparotor name on Menu, Logout if unsuccessful ping Part VII | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Gtk;
namespace Moscrif.IDE.Components
{
class DropDownRadioButton: DropDownButton
{
public DropDownRadioButton()
{
}
protected override void OnPressed ()
{
//base.OnPressed ();
Gtk.Menu menu = new Gtk.Menu... | |
Allow running gzip-ped script from URL | using System;
using System.IO;
using System.Net.Http;
using System.Net.Mime;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
const string plainTextMediaType = "text/plain";
usi... | using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Threading.Tasks;
namespace Dotnet.Script.Core
{
public class ScriptDownloader
{
public async Task<string> Download(string uri)
{
using (HttpClient client = new HttpClient())
... |
Add missed paren in comment. | using System;
using System.Threading;
namespace ProcessTest_ConsoleApp
{
class Program
{
static int Main(string[] args)
{
try
{
if (args.Length > 0)
{
if (args[0].Equals("infinite"))
{
... | using System;
using System.Threading;
namespace ProcessTest_ConsoleApp
{
class Program
{
static int Main(string[] args)
{
try
{
if (args.Length > 0)
{
if (args[0].Equals("infinite"))
{
... |
Set specs on all tiles at Awake() | using UnityEngine;
using UnityEngine.Assertions;
public class TileSystemManager : BaseBehaviour
{
private Shader shader;
void Start()
{
shader = Shader.Find("Sprites/Diffuse");
Assert.IsNotNull(shader);
SetChunksToStatic();
DisableShadows();
}
void SetChunksToStatic()
{
foreach (Transform child in t... | |
Add TLS token binding feature | // 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;
using Microsoft.Framework.Runtime;
namespace Microsoft.AspNet.Http.Interfaces
{
/// <summary>
/// Provides infor... | |
Add items for database persistence | namespace food_tracker {
public class NutritionItem {
public string name { get; set; }
public double calories { get; set; }
public double carbohydrates { get; set; }
public double sugars { get; set; }
public double fats { get; set; }
public double saturatedFats { get... | |
Add a abstract server class. Watch out for the todos. | /*
* WoWCore - World of Warcraft 1.12 Server
* Copyright (C) 2017 exceptionptr
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your op... | |
Add assembly info for new project | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Reflection;
using System.Resources;
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: NeutralResourcesLanguage("en-us")] | |
Implement CartSpecs to Control Specification | using WJStore.Domain.Interfaces.Validation;
namespace WJStore.Domain.Entities.Specifications.CartSpecs
{
public class CartCountShouldBeGreaterThanZeroSpec : ISpecification<Cart>
{
public bool IsSatisfiedBy(Cart cart)
{
return cart.Count > 0;
}
}
}
| |
Use the correct icon for osu!direct in the toolbar | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarDirectButton : ToolbarOverlayToggleButt... | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarDirectButton : ToolbarOverlayToggleButt... |
Add test fixture for secret splitting | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace ElectronicCash.Tests
{
[TestFixture]
class SecretSplittingTests
{
private static readonly byte[] _message = Helpers.GetBytes("Supersecretmessage");
... | |
Add a logging effect to debug | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SmokeScreen
{
[EffectDefinition("DEBUG_EFFECT")]
class DebugEffect : EffectBehaviour
{
public override void OnEvent()
{
Print(effectName.PadRight(16) + "OnEvent single --------------... | |
Implement test for client login. | using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moegirlpedia.MediaWikiInterop.Actions;
using Moegirlpedia.MediaWikiInterop.Actions.Models;
using Moegirlpedia.MediaWikiInterop.Actions.QueryProviders;
using Moegirlpedia.MediaWikiInterop.Primitives.DependencyInjection;
using System;
using System.Threading.Tasks... | |
Add a script for check if we are a tank. | switch (ObjectManager.Me.WowSpecialization())
{
case WoWSpecialization.PaladinProtection:
case WoWSpecialization.WarriorProtection:
case WoWSpecialization.MonkBrewmaster:
case WoWSpecialization.DruidGuardian:
case WoWSpecialization.DeathknightBlood:
return true;
default:
return false;
}
// Usage: <ScriptCond... | |
Add date time passing practices. | using System;
using System.Collections.Generic;
using System.Globalization;
using Xunit;
namespace CSharpViaTest.OtherBCLs.HandleDates
{
/*
* Description
* ===========
*
* This test will try passing date time between the boundary (e.g. via HTTP).
* And the culture information at each si... | |
Add script for serializing level data | using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System;
using UnityEngine;
public class LevelData : BaseBehaviour
{
public int HP { get; set; }
public int AC { get; set; }
public int Damage { get; set; }
public void Save()
{
var bf = new BinaryFormatter();
FileStream file... | |
Split model class for mod state | // 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.Mods;
namespace osu.Game.Overlays.Mods
{
/// <summary>
/// Wrapper class used to store the current state o... | |
Add IProvideExpenditure class to support data provision | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GeneralUseClasses.Contracts;
namespace GeneralUseClasses.Services
{
public interface IProvideExpenditureData
{
IEnumerable<string> GetDominantTags();
IEnumerable<string> ... | |
Add tagging capability to Dinamico news page | @model Dinamico.Models.ContentPage
@{
Content.Define(re =>
{
re.Title = "News page";
re.IconUrl = "{IconsUrl}/newspaper.png";
re.DefaultValue("Visible", false);
re.RestrictParents("Container");
re.Sort(N2.Definitions.SortBy.PublishedDescending);
});
}
@Html.Partial("LayoutPartials/BlogCont... | @model Dinamico.Models.ContentPage
@{
Content.Define(re =>
{
re.Title = "News page";
re.IconUrl = "{IconsUrl}/newspaper.png";
re.DefaultValue("Visible", false);
re.RestrictParents("Container");
re.Sort(N2.Definitions.SortBy.PublishedDescending);
re.Tags("Tags");
});
}
@Html.Partial("Lay... |
Hide logout when not using forms auth |
namespace N2.Management
{
public partial class Top : System.Web.UI.MasterPage
{
}
}
| using System.Configuration;
using System.Web.Configuration;
namespace N2.Management
{
public partial class Top : System.Web.UI.MasterPage
{
protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);
try
{
var section = (AuthenticationSection)ConfigurationManager.GetSection("... |
Add a factory for Property path element | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Pather.CSharp.PathElements
{
public class PropertyFactory : IPathElementFactory
{
public IPathElement Create(string pathElement)
{
return... | |
Add Rect <-> Vector2i collisions | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using neon2d.Math;
namespace neon2d.Physics
{
public class Rect
{
public float x, y;
public float width, height;
public Rect(int x, int y, int width, int height)
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using neon2d.Math;
namespace neon2d.Physics
{
public class Rect
{
public float x, y;
public float width, height;
public Rect(int x, int y, int width, int height)
... |
Add extension method to provide drawable adjustments | // 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;
namespace osu.Framework.Graphics
{
/// <summary>
/// Holds extension methods for <see cref="Drawable"/>.
/// </summary>
public static class... | |
Fix warnings in unit tests flagged by MSBuild Log |
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", ... | |
Add a button press example | using UnityEngine;
using System.Collections;
public class HandleButtonPress : MonoBehaviour {
public OSVR.Unity.OSVRClientKit clientKit;
public OSVR.Unity.InterfaceCallbacks cb;
public void Start() {
GetComponent<OSVR.Unity.InterfaceCallbacks> ().RegisterCallback (handleButton);
}
public void handleButton(... | |
Add unit tests for UaTcpChannelOptions | using FluentAssertions;
using System;
using System.Collections.Generic;
using System.Text;
using Workstation.ServiceModel.Ua;
using Xunit;
namespace Workstation.UaClient.UnitTests
{
public class UaApplicationOptionsTests
{
[Fact]
public void UaTcpTransportChannelOptionsDefaults()
{
... | |
Create a class that is used to process the restQL queries. | using System;
using System.Collections.Generic;
using System.Text;
namespace Nohros.Toolkit.RestQL
{
/// <summary>
/// A class used to process a restQL query.
/// </summary>
public class QueryProcessor
{
QueryInfo query_;
string query_key_;
#region .ctor
/// <summary>
//... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.