Skip to content

Instantly share code, notes, and snippets.

Avatar

Bernard Vukas bervukas

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am bervukas on github.
  • I am bvukas (https://keybase.io/bvukas) on keybase.
  • I have a public key ASCP4a7mtsGfbozAVML6c0ycUCMThqd4-OF-uH4jhXfstwo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am bervukas on github.
  • I am bvukas (https://keybase.io/bvukas) on keybase.
  • I have a public key ASAOi3k7ofi2YVwvQXPTF1GSA6atPVG1_eI_j11K5AJXOwo

To claim this, I am signing this object:

View TestingValidatePasswordLength.vb
Option Explicit
Option Private Module
'@TestModule
'@Folder("Tests")
Private Assert As Object
'@ModuleInitialize
Public Sub ModuleInitialize()
View NewTestMethod.vb
'@TestMethod
Public Sub TestMethod1() 'TODO Rename test
On Error GoTo TestFail
'Arrange:
'Act:
'Assert:
Assert.Inconclusive
@bervukas
bervukas / ExcelCodedUIDemo.cs
Last active Dec 23, 2016
Sample snippet used in Coded UI Test for an Excel COM add-in
View ExcelCodedUIDemo.cs
// Launch Excel 2016 from '%ProgramFiles%\Microsoft Office\root\Office16\EXCEL.EXE'
ApplicationUnderTest excelApp = ApplicationUnderTest.Launch(this.StartAndQuitExcelParams.ExePath, this.StartAndQuitExcelParams.AlternateExePath);
// After Excel loads, click the 'Blank workbook' list item
Mouse.Click(blankWorkbookListItem, new Point(117, 182));
// Select your add-in's ribbon tab
Mouse.Click(myAddinRibbonTab, new Point(276, 771));
// Click a control on your add-in's ribbon, in order to display the VBA userform
@bervukas
bervukas / EmptyTestMethod.vb
Created May 4, 2016
Empty Test Method in Rubberduck VBA
View EmptyTestMethod.vb
'@TestMethod
Public Sub TestMethod1() 'TODO: Rename test
On Error GoTo TestFail
'Arrange:
'Act:
'Assert:
Assert.Inconclusive
@bervukas
bervukas / ExcelVBAUnitTest.vb
Last active May 27, 2019
Tutorial: Excel Unit Testing with VBA
View ExcelVBAUnitTest.vb
Option Explicit
''
' Validate the password length so that it's between 8-16 characters long
'
' Returns:
'
' TRUE - Password matches the lenght requirement
' FALSE - Password doesn't match the length requirement
@bervukas
bervukas / Validation.vb
Last active Feb 28, 2016
Example: Data validation in VBA
View Validation.vb
Function Test(L1 As Long, L2 As Long, Optional P1 As Variant, Optional P2 As Variant) As String
Dim S As String
If IsMissing(P1) = True Then
S = "P1 Is Missing."
Else
S = "P1 Is Present (P1 = " & CStr(P1) & ")"
End If
@bervukas
bervukas / UsingParameters.vb
Last active Mar 1, 2016
Example: Using Function and Sub Parameters in VBA
View UsingParameters.vb
Function CreateProposal(clientName As String,
clientId As Integer,
title As String,
subtitle As String,
projectName As String,
reportDate As Date,
preparedBy As String,
reviewedBy As String,
authoredBy As String,
fontSize As Integer) As Boolean
@bervukas
bervukas / CodingErrorsTest.vb
Created Feb 28, 2016
VBA Code Check: How many coding errors can you find?
View CodingErrorsTest.vb
Function CalculateHourlyRate()
End Sub