Skip to content

Instantly share code, notes, and snippets.

View mrtank's full-sized avatar

Márton Garai mrtank

  • Budapest, Hungary
View GitHub Profile
@mrtank
mrtank / SequentialProviderTest.cs
Created March 20, 2020 10:45
test architecture
namespace ThickClient.SequentialNumber.Tests
{
...
[TestClass]
public class SequentialProviderTest
{
[TestMethod]
public void CreatsEmptyFile()
{
// Arrange
public abstract class ApiCaller
{
...
public TRecord Get< TRecord >( string url )
{
TRecord item = default( TRecord );
try
{
var response = GetHttpClient( ).GetAsync( $"{url}" ).Result;
EnsureSuccessStatusCode( response );
public static class IocKernel
{
private static StandardKernel _kernel;
private static int _sendingChainDepth;
private static FormBase _latestViewModel;
public static void SendTo<T>() where T: FormBase
{
if (_kernel == null)
return;
internal class User: IUser
{
async Task<TLoginUserResponse> IUser.LoginUser<TLoginUserDTO, TLoginUserResponse>(TLoginUserDTO loginUserDTO)
{
...
var loginUserDTODerived = (LoginUserDTO) (ILoginUserDTO) loginUserDTO;
var dummy = loginUserDTODerived.NewProp;
...
namespace RxSocketTest.TestDoubles.GlobalStates
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using RxSocket;
using TestDoubles;
@mrtank
mrtank / ReqresReader.cs
Created March 11, 2019 10:27
Handling async in Rx.
namespace PrimeFactors
{
using System;
using System.Net.Http;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
class ReqresReader
{
private void SetConfigFile(Dictionary<string, string> configParams, string sid)
{
Configuration cfg = WebConfigurationManager.OpenWebConfiguration("/");
var destinationConfigurationSection = cfg.GetSection("SAP.Middleware.Connector/ClientSettings/DestinationConfiguration");
var destinationConfigurationType = typeof(RfcDestination).Assembly.GetType("SAP.Middleware.Connector.RfcDestinationConfiguration");
var destinationCollectionType = typeof(RfcDestination).Assembly.GetType("SAP.Middleware.Connector.RfcDestinationCollection");
var destinationParametersType =
typeof(RfcDestination).Assembly.GetType("SAP.Middleware.Connector.RfcDestinationParameters");
BindingFlags bindFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Static;
@mrtank
mrtank / Program.fs
Created August 17, 2018 14:50
Matrix
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
open System
open System.Runtime.InteropServices
open System.Text
type HANDLE = nativeint
[<StructLayout(LayoutKind.Sequential)>]
type COORD =
@mrtank
mrtank / PrimeFactorTests.fs
Last active March 7, 2018 10:39
PrimeFactorsFsharp
namespace PrimeFactors
open PrimeFactors
open NUnit.Framework
open FsUnit
open PrimeFactorsMock
[<TestFixture>]
module PrimeFactorTests =
namespace SqlStuff
{
using System.Data.SqlClient;
using System;
using System.Collections.Generic;
public static class Class1
{
public static IEnumerable<IDictionary<String, Object>> ReadStuff(this SqlConnection connection)
{