Skip to content

Instantly share code, notes, and snippets.

View InternetCaller.cs
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace HttpClientTest.Class
{
public interface ICallTheInternet
{
public Task<bool> GetWithNamedClient(string clientName, string url, HttpStatusCode expectedStatusCode);
View InternetCallerTests.cs
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using HttpClientTest.Class;
using Moq;
using Xunit;
namespace HttpClientTest.Tests
View TextField.test.js
import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import TextField from '@material-ui/core/TextField';
describe("TextField onChange demo", () => {
it.each`
initialValue | changeValue
${"test"} | ${"changed"}
${"test"} | ${"test"}
`("given a text field with initial value '$initialValue' when changed to '$changeValue' then the onChange handler should be called", ({ initialValue, changeValue }) => {
View updated withProbabilityInputValidation.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
export const withProbabilityInputValidation = (WrappedComponent) => {
class ProbabilityInputValidation extends Component {
constructor(props) {
super(props);
this.state = {
isValid: true
};
View withProbabilityInputValidation.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
export const withProbabilityInputValidation = (WrappedComponent) => {
class ProbabilityInputValidation extends Component {
constructor(props) {
super(props);
this.state = {
isValid: true
};
View terminal-settings.json
// This file was initially generated by Windows Terminal 1.2.2381.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
View MockingUtils.cs
using System;
using System.Linq;
using System.Linq.Expressions;
namespace Moq
{
public static class MockingUtilities
{
public static Mock<T> AutoMockFluentInterface<T>(this Mock<T> interfaceMock) where T:class
{
@steve-codemunkies
steve-codemunkies / profiles.json
Created Dec 20, 2019
Windows Terminal Profile
View profiles.json
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"initialCols": 150,
View keybase.md

Keybase proof

I hereby claim:

  • I am steve-codemunkies on github.
  • I am stevehocking (https://keybase.io/stevehocking) on keybase.
  • I have a public key ASABXYgdHaSXvdElbMBzGh8MkYHEGP2IwnIJ4ba3pg4-fgo

To claim this, I am signing this object:

View PerformanceCounter.cs
var counter = new PerformanceCounter("MyCategory", "AverageOperationTime", false);
var baseCounter = new PerformanceCounter("MyCategory", "AverageOperationTimeBase", false);
var start = Stopwatch.GetTimestamp();
Thread.Sleep(500);
counter.IncrementBy(Stopwatch.GetTimestamp() - start);
baseCounter.Increment();