Skip to content

Instantly share code, notes, and snippets.

View thargenediad's full-sized avatar

Anton Thorn thargenediad

View GitHub Profile
@thargenediad
thargenediad / XUnitOutputDemo.cs
Created January 20, 2023 20:00
Capture `Console.Out` and Trace Logs in an XUnit `ITestOutputHelper`
public class XUnitOutputDemo : IDisposable
{
private readonly TextWriter consoleOut;
private readonly XUnitTestOutputHelperToTextWriterConverter outAdapter;
public XUnitOutputDemo(ITestOutputHelper output)
{
consoleOut = Console.Out;
converter = new XUnitTestOutputHelperToTextWriterConverter(output);
Console.SetOut(converter);
@thargenediad
thargenediad / index.js
Created March 24, 2020 04:07
PickerDropDown class for React Native (fixes Picker issues on iOS) - modified version of the one written by @kevin and shared to StackOverflow: https://stackoverflow.com/users/4135310/kevin
import React from 'react';
import { View, Picker, ActionSheetIOS, Platform, StyleSheet } from 'react-native';
import { Button, Icon } from 'react-native-elements';
export default class PickerDropDown extends React.Component {
onIOSButton = () => {
let options = this.props.children.map((item, i) => {
return item.props.label;
});
options.push("Cancel");