Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed May 6, 2020
2 parents 4aadfa4 + 7a8cef4 commit c43573c
Show file tree
Hide file tree
Showing 67 changed files with 4,888 additions and 125 deletions.
51 changes: 47 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,54 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
# This file is the top-most EditorConfig file
root = true

# Windows-style newlines with a newline ending every file
# All Files
[*]
charset = utf-8
end_of_line = crlf
indent_style = space
indent_size = 4
insert_final_newline = false
trim_trailing_whitespace = true

# .NET Code files
[*.{cs,csx,cake,vb}]
indent_style = tab
tab_width = 4
insert_final_newline = true

# Visual Studio Solution Files
[*.sln]
indent_style = tab
tab_width = 4

# Visual Studio XML Project Files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Various XML Configuration Files
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
indent_size = 2

# JSON Files
[*.{json,json5}]
indent_size = 2

# YAML Files
[*.{yml,yaml}]
indent_size = 2

# Markdown Files
[*.md]
trim_trailing_whitespace = false

# Web Files
[*.{htm,html,js,ts,tsx,css,sass,scss,less,svg,vue}]
indent_size = 2
insert_final_newline = true

# Batch Files
[*.{cmd,bat}]

# Bash Files
[*.sh]
end_of_line = lf
24 changes: 15 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Mono auto generated files
mono_crash.*

# Build results
[Dd]ebug/
[Dd]ebugPublic/
Expand All @@ -43,9 +46,10 @@ Generated\ Files/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml

# Build Results of an ATL Project
[Dd]ebugPS/
Expand All @@ -68,7 +72,6 @@ StyleCopReport.xml
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
Expand Down Expand Up @@ -186,6 +189,8 @@ PublishScripts/

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
Expand All @@ -210,6 +215,8 @@ BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload

# Visual Studio cache files
# files ending in .cache can be ignored
Expand All @@ -235,8 +242,6 @@ orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true
**/wwwroot/lib/

# RIA/Silverlight projects
Generated_Code/
Expand All @@ -261,7 +266,9 @@ ServiceFabricBackup/
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- Backup*.rdl
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl

# Microsoft Fakes
FakesAssemblies/
Expand Down Expand Up @@ -297,10 +304,6 @@ paket-files/
# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush personal settings
.cr/personal

Expand Down Expand Up @@ -345,6 +348,9 @@ ASALocalRun/
# BeatPulse healthcheck temp database
healthchecksdb

# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/

# WinMerge
*.bak

Expand Down
38 changes: 26 additions & 12 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,38 @@ create:
footer-content: You can download this release from [nuget.org](https://www.nuget.org/packages/ZoomNet/{milestone})
footer-includes-milestone: true
milestone-replace-text: '{milestone}'
close:
use-issue-comments: true
issue-comment: |-
:tada: This issue has been resolved in version {milestone} :tada:
The release is available on:
- [GitHub Release](https://github.com/{owner}/{repository}/releases/tag/{milestone})
- [NuGet Package](https://www.nuget.org/packages/ZoomNet/{milestone})
Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket:
export:
include-created-date-in-title: true
created-date-string-format: MMMM dd, yyyy
perform-regex-removal: true
regex-text: '### Where to get it(\r\n)*You can .*\)'
multiline-regex: true
issue-labels-include:
- Breaking Change
- Bug
- New Feature
- Improvement
- Documentation
- Breaking Change
- Bug
- New Feature
- Improvement
- Documentation
- Security
issue-labels-exclude:
- Question
- Duplicate
- Invalid
- Wontfix
- Question
- Duplicate
- Invalid
- Wontfix
- Build
- Internal Refactoring
issue-labels-alias:
- name: Documentation
header: Documentation
plural: Documentation
- name: Documentation
header: Documentation
plural: Documentation
3 changes: 3 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
mode: ContinuousDelivery
branches:
feature:
regex: feature(s)?[/-]
mode: ContinuousDeployment
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
Expand Down
32 changes: 32 additions & 0 deletions Source/ZoomNet.IntegrationTests/ConsoleUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;

namespace ZoomNet.IntegrationTests
{
public static class ConsoleUtils
{
public static void CenterConsole()
{
var hWin = NativeMethods.GetConsoleWindow();
if (hWin == IntPtr.Zero) return;

var monitor = NativeMethods.MonitorFromWindow(hWin, NativeMethods.MONITOR_DEFAULT_TO_NEAREST);
if (monitor == IntPtr.Zero) return;

var monitorInfo = new NativeMethods.NativeMonitorInfo();
NativeMethods.GetMonitorInfo(monitor, monitorInfo);

NativeMethods.GetWindowRect(hWin, out NativeMethods.NativeRectangle consoleInfo);

var monitorWidth = monitorInfo.Monitor.Right - monitorInfo.Monitor.Left;
var monitorHeight = monitorInfo.Monitor.Bottom - monitorInfo.Monitor.Top;

var consoleWidth = consoleInfo.Right - consoleInfo.Left;
var consoleHeight = consoleInfo.Bottom - consoleInfo.Top;

var left = monitorInfo.Monitor.Left + ((monitorWidth - consoleWidth) / 2);
var top = monitorInfo.Monitor.Top + ((monitorHeight - consoleHeight) / 2);

NativeMethods.MoveWindow(hWin, left, top, consoleWidth, consoleHeight, false);
}
}
}
11 changes: 11 additions & 0 deletions Source/ZoomNet.IntegrationTests/IIntegrationTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace ZoomNet.IntegrationTests
{
public interface IIntegrationTest
{
Task RunAsync(string userId, IClient client, TextWriter log, CancellationToken cancellationToken);
}
}
52 changes: 52 additions & 0 deletions Source/ZoomNet.IntegrationTests/NativeMethods.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Runtime.InteropServices;

namespace ZoomNet.IntegrationTests
{
public static class NativeMethods
{
public const Int32 MONITOR_DEFAULT_TO_PRIMARY = 0x00000001;
public const Int32 MONITOR_DEFAULT_TO_NEAREST = 0x00000002;

[DllImport("kernel32.dll", SetLastError = true)]
public static extern IntPtr GetConsoleWindow();

[DllImport("user32.dll", SetLastError = true)]
public static extern bool GetWindowRect(IntPtr hWnd, out NativeRectangle rc);

[DllImport("user32.dll", SetLastError = true)]
public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int w, int h, bool repaint);

[DllImport("user32.dll")]
public static extern IntPtr MonitorFromWindow(IntPtr handle, Int32 flags);

[DllImport("user32.dll")]
public static extern Boolean GetMonitorInfo(IntPtr hMonitor, NativeMonitorInfo lpmi);

[Serializable, StructLayout(LayoutKind.Sequential)]
public struct NativeRectangle
{
public Int32 Left;
public Int32 Top;
public Int32 Right;
public Int32 Bottom;

public NativeRectangle(Int32 left, Int32 top, Int32 right, Int32 bottom)
{
this.Left = left;
this.Top = top;
this.Right = right;
this.Bottom = bottom;
}
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public sealed class NativeMonitorInfo
{
public Int32 Size = Marshal.SizeOf(typeof(NativeMonitorInfo));
public NativeRectangle Monitor;
public NativeRectangle Work;
public Int32 Flags;
}
}
}
54 changes: 54 additions & 0 deletions Source/ZoomNet.IntegrationTests/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Logzio.DotNet.NLog;
using Microsoft.Extensions.DependencyInjection;
using NLog.Config;
using NLog.Extensions.Logging;
using NLog.Targets;
using System;
using System.Threading.Tasks;

namespace ZoomNet.IntegrationTests
{
public class Program
{
public static async Task<int> Main(string[] args)
{
var services = new ServiceCollection();
ConfigureServices(services);
await using var serviceProvider = services.BuildServiceProvider();
var app = serviceProvider.GetService<TestsRunner>();
return await app.RunAsync().ConfigureAwait(false);
}

private static void ConfigureServices(ServiceCollection services)
{
services
.AddLogging(loggingBuilder => loggingBuilder.AddNLog(GetNLogConfiguration()))
.AddTransient<TestsRunner>();
}

private static LoggingConfiguration GetNLogConfiguration()
{
// Configure logging
var nLogConfig = new LoggingConfiguration();

// Send logs to logz.io
var logzioToken = Environment.GetEnvironmentVariable("LOGZIO_TOKEN");
if (!string.IsNullOrEmpty(logzioToken))
{
var logzioTarget = new LogzioTarget { Token = logzioToken };
logzioTarget.ContextProperties.Add(new TargetPropertyWithContext("source", "ZoomNet_integration_tests"));
logzioTarget.ContextProperties.Add(new TargetPropertyWithContext("ZoomNet-Version", ZoomNet.Client.Version));

nLogConfig.AddTarget("Logzio", logzioTarget);
nLogConfig.AddRule(NLog.LogLevel.Debug, NLog.LogLevel.Fatal, "Logzio", "*");
}

// Send logs to console
var consoleTarget = new ColoredConsoleTarget();
nLogConfig.AddTarget("ColoredConsole", consoleTarget);
nLogConfig.AddRule(NLog.LogLevel.Warn, NLog.LogLevel.Fatal, "ColoredConsole", "*");

return nLogConfig;
}
}
}
Loading

0 comments on commit c43573c

Please sign in to comment.