Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
asheroto committed Aug 25, 2023
1 parent 9585120 commit 3a5c165
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 66 deletions.
6 changes: 4 additions & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
![Uninstall Teams](https://github.com/asheroto/UninstallTeams/assets/49938263/aaa5ab1a-40f3-4a38-bf44-5ee7dbece2df)

[![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/asheroto/UninstallTeams)](https://github.com/asheroto/UninstallTeams/releases)
[![GitHub Downloads - All Releases](https://img.shields.io/github/downloads/asheroto/UninstallTeams/total)](https://github.com/sponsors/asheroto)
[![GitHub Downloads - All Releases](https://img.shields.io/github/downloads/asheroto/UninstallTeams/total)](https://github.com/asheroto/UninstallTeams/releases)
[![GitHub Sponsor](https://img.shields.io/github/sponsors/asheroto?label=Sponsor&logo=GitHub)](https://github.com/sponsors/asheroto)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/asheroto)
<a href="https://ko-fi.com/asheroto"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Ko-Fi Button" height="20px"></a>

# UninstallTeams

Expand Down
128 changes: 64 additions & 64 deletions UninstallTeams.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,87 +14,87 @@ Describe "Get-ChatWidgetStatus Function" {
Context "When the registry key is missing" {
It "Should return 'Not Set'" {
$status = Get-ChatWidgetStatus
if ($status -eq "Not Set") {
# Test passed
$true | Should -Be $true
} elseif ($status -eq "Hidden") {
# Test passed but with unexpected result, display a warning
Write-Warning "Unexpected result: The registry key is missing, but the status is 'Hidden'."
$true | Should -Be $true
} else {
# Test failed
Throw "Test failed: Unexpected status '$status' returned."
}
if ($status -eq "Unset (default is enabled)")
# Test passed
$true | Should -Be $true
} elseif ($status -eq "Hidden") {
# Test passed but with unexpected result, display a warning
Write-Warning "Unexpected result: The registry key is missing, but the status is 'Hidden'."
$true | Should -Be $true
} else {
# Test failed
Throw "Test failed: Unexpected status '$status' returned."
}
}
}

Context "When ChatIcon value is 1" {
It "Should return 'Enabled'" {
# Set the ChatIcon value to 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Value 1 -Type DWord -Force
$status = Get-ChatWidgetStatus
$status | Should -Be "Enabled"
# Remove the ChatIcon value
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Force
}
Context "When ChatIcon value is 1" {
It "Should return 'Enabled'" {
# Set the ChatIcon value to 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Value 1 -Type DWord -Force
$status = Get-ChatWidgetStatus
$status | Should -Be "Enabled"
# Remove the ChatIcon value
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Force
}
}

Context "When ChatIcon value is 2" {
It "Should return 'Hidden'" {
# Set the ChatIcon value to 2
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Value 2 -Type DWord -Force
$status = Get-ChatWidgetStatus
$status | Should -Be "Hidden"
# Remove the ChatIcon value
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Force
}
Context "When ChatIcon value is 2" {
It "Should return 'Hidden'" {
# Set the ChatIcon value to 2
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Value 2 -Type DWord -Force
$status = Get-ChatWidgetStatus
$status | Should -Be "Hidden"
# Remove the ChatIcon value
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Force
}
}

Context "When ChatIcon value is 3" {
It "Should return 'Disabled'" {
# Set the ChatIcon value to 3
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Value 3 -Type DWord -Force
$status = Get-ChatWidgetStatus
$status | Should -Be "Disabled"
# Remove the ChatIcon value
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Force
}
Context "When ChatIcon value is 3" {
It "Should return 'Disabled'" {
# Set the ChatIcon value to 3
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Value 3 -Type DWord -Force
$status = Get-ChatWidgetStatus
$status | Should -Be "Disabled"
# Remove the ChatIcon value
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Chat" -Name "ChatIcon" -Force
}
}

Context "When -AllUsers switch is used without -EnableChatWidget, -DisableChatWidget, or -UnsetChatWidget" {
It "Should not throw an error" {
{ Get-ChatWidgetStatus -AllUsers } | Should -Not -Throw
}
Context "When -AllUsers switch is used without -EnableChatWidget, -DisableChatWidget, or -UnsetChatWidget" {
It "Should not throw an error" {
{ Get-ChatWidgetStatus -AllUsers } | Should -Not -Throw
}
}

Context "When -AllUsers switch is used with -EnableChatWidget" {
It "Should set the Chat widget status for all users" {
Set-ChatWidgetStatus -EnableChatWidget -AllUsers
$status = Get-ChatWidgetStatus -AllUsers
$status | Should -Be "Enabled"
# Disable the Chat widget for all users
Set-ChatWidgetStatus -DisableChatWidget -AllUsers
}
Context "When -AllUsers switch is used with -EnableChatWidget" {
It "Should set the Chat widget status for all users" {
Set-ChatWidgetStatus -EnableChatWidget -AllUsers
$status = Get-ChatWidgetStatus -AllUsers
$status | Should -Be "Enabled"
# Disable the Chat widget for all users
Set-ChatWidgetStatus -DisableChatWidget -AllUsers
}
}

Context "When -AllUsers switch is used with -DisableChatWidget" {
It "Should set the Chat widget status for all users" {
Set-ChatWidgetStatus -DisableChatWidget -AllUsers
$status = Get-ChatWidgetStatus -AllUsers
$status | Should -Be "Disabled"
# Enable the Chat widget for all users
Set-ChatWidgetStatus -EnableChatWidget -AllUsers
}
Context "When -AllUsers switch is used with -DisableChatWidget" {
It "Should set the Chat widget status for all users" {
Set-ChatWidgetStatus -DisableChatWidget -AllUsers
$status = Get-ChatWidgetStatus -AllUsers
$status | Should -Be "Disabled"
# Enable the Chat widget for all users
Set-ChatWidgetStatus -EnableChatWidget -AllUsers
}
}

Context "When -AllUsers switch is used with -UnsetChatWidget" {
It "Should set the Chat widget status for all users" {
Set-ChatWidgetStatus -UnsetChatWidget -AllUsers
$status = Get-ChatWidgetStatus -AllUsers
$status | Should -Be "Not Set"
}
Context "When -AllUsers switch is used with -UnsetChatWidget" {
It "Should set the Chat widget status for all users" {
Set-ChatWidgetStatus -UnsetChatWidget -AllUsers
$status = Get-ChatWidgetStatus -AllUsers
$status | Should -Be "Not Set"
}
}
}

Describe "Set-ChatWidgetStatus Function" {
Context "When -EnableChatWidget switch is used" {
Expand Down

0 comments on commit 3a5c165

Please sign in to comment.