CanScan
Loading...
Searching...
No Matches
fr.softsf.canscan.CanScanUTest Class Reference

Suite de tests unitaires pour la logique principale de CanScan. More...

Collaboration diagram for fr.softsf.canscan.CanScanUTest:

Package Functions

void givenAllBlankFields_whenBuildMecard_thenReturnEmptyString ()
void givenAllContactFields_whenBuildMecard_thenReturnCompleteMecardString ()
void givenBlackColor_whenConvertToHex_thenReturn000000 ()
void givenBlackWhiteImage_whenDrawSquareFinderPattern_thenPatternDrawnAtOrigin ()
void givenBlueColorSelected_whenChooseBgColor_thenButtonTextAndColorUpdated ()
void givenColorDialogCancelled_whenChooseColor_thenButtonTextUnchanged ()
void givenConfigWithCustomColors_whenGenerateQrCodeImage_thenReturn300x300Image () throws Exception
void givenConfigWithLargeLogoRatio_whenGenerateQrCodeImage_thenReturnValidImage () throws Exception
void givenConfigWithoutLogo_whenGenerateQrCodeImage_thenReturn400x400Image () throws Exception
void givenConfigWithRoundedModules_whenGenerateQrCodeImage_thenReturn400x400Image () throws Exception
void givenConfigWithZeroMargin_whenGenerateQrCodeImage_thenReturnValidImage () throws Exception
void givenCustomColor_whenConvertToHex_thenReturnCorrectHex ()
void givenDifferentImageRatios_whenDrawLogoIfPresent_thenLogoScaledCorrectly (double ratio) throws Exception
void givenEmptyMecardFields_whenBuildQrData_thenReturnEmptyString ()
void givenFileSelected_whenBrowseLogo_thenLogoFieldUpdated ()
void givenFileSelectionCancelled_whenBrowseLogo_thenLogoFieldUnchanged ()
void givenFreeMode_whenGetModeText_thenReturnSaisieLibre ()
void givenFreeMode_whenSwitchToMecardMode_thenCurrentModeIsMecard ()
void givenFreeModeWithText_whenBuildQrData_thenReturnFreeText ()
void givenJPEGLogo_whenDrawLogoIfPresent_thenLogoDrawnSuccessfully () throws Exception
void givenLargeQRSize_whenDrawLogoIfPresent_thenLogoScaledProperly () throws Exception
void givenLogoWithTransparency_whenDrawLogoIfPresent_thenLogoDrawnWithAlpha () throws Exception
void givenMarginAboveMaximum_whenMarginFieldCheck_thenGetMarginSetTo10 ()
void givenMecardMode_whenGetModeText_thenReturnContact ()
void givenMecardMode_whenSwitchToFreeMode_thenCurrentModeIsFree ()
void givenMecardModeWithContactData_whenBuildQrData_thenReturnMecardString ()
void givenNegativeMargin_whenMarginFieldCheck_thenGetMarginSetTo0 ()
void givenNonExistentLogoFile_whenDrawLogoIfPresent_thenReturnWithoutException ()
void givenNullConfig_whenDrawLogoIfPresent_thenReturnWithoutException ()
void givenNullGraphics_whenDrawLogoIfPresent_thenReturnWithoutException () throws Exception
void givenNullLogoFile_whenDrawLogoIfPresent_thenReturnWithoutException ()
void givenOnlyNameField_whenBuildMecard_thenReturnMecardWithNameOnly ()
void givenQrImage_whenDrawFinderPatterns_thenAllThreePatternsDrawn ()
void givenRatioPercent_whenRatioFieldCheck_thenGetRatioSetCorrectly (int sliderValue, double expectedRatio)
void givenRedColorSelected_whenChooseQrColor_thenButtonTextAndColorUpdated ()
void givenSmallQRSize_whenDrawLogoIfPresent_thenLogoScaledProperly () throws Exception
void givenValidLogo_whenDrawLogoIfPresent_thenLogoCenteredCorrectly () throws Exception
void givenValidLogo_whenDrawLogoIfPresent_thenLogoDrawnOnImage () throws Exception
void givenValidMargin4_whenMarginFieldCheck_thenGetMarginUpdatedTo4 ()
void givenVariousSizeInputs_whenValidateAndGetSize_thenReturnExpectedResult (String input, int expected) throws Exception
void givenWhiteColor_whenConvertToHex_thenReturnFFFFFF ()
void givenZeroImageRatio_whenDrawLogoIfPresent_thenReturnWithoutException () throws Exception
void setUp () throws InterruptedException, InvocationTargetException
 Initialisation de l'instance de test et configuration des champs par défaut.
void tearDown () throws InterruptedException, InvocationTargetException
 Nettoyage après chaque test : fermeture de la fenêtre et libération des ressources.

Package Attributes

File tempDir

Private Member Functions

File createTestLogoFile (String filename) throws IOException
 Crée un fichier image temporaire pour les besoins des tests.
File createTestLogoFileWithAlpha () throws IOException
 Crée un fichier image avec transparence pour tester le canal Alpha.
void executeWithoutDialog (Runnable test)
 Exécute un test en simulant l'absence d'interaction utilisateur via JOptionPane.

Private Attributes

ColorOperation colorOperation
CanScan generator

Detailed Description

Suite de tests unitaires pour la logique principale de CanScan.

Member Function Documentation

◆ createTestLogoFile()

File fr.softsf.canscan.CanScanUTest.createTestLogoFile ( String filename) throws IOException
private

Crée un fichier image temporaire pour les besoins des tests.

◆ createTestLogoFileWithAlpha()

File fr.softsf.canscan.CanScanUTest.createTestLogoFileWithAlpha ( ) throws IOException
private

Crée un fichier image avec transparence pour tester le canal Alpha.

◆ executeWithoutDialog()

void fr.softsf.canscan.CanScanUTest.executeWithoutDialog ( Runnable test)
private

Exécute un test en simulant l'absence d'interaction utilisateur via JOptionPane.

◆ givenAllBlankFields_whenBuildMecard_thenReturnEmptyString()

void fr.softsf.canscan.CanScanUTest.givenAllBlankFields_whenBuildMecard_thenReturnEmptyString ( )
package
Here is the call graph for this function:

◆ givenAllContactFields_whenBuildMecard_thenReturnCompleteMecardString()

void fr.softsf.canscan.CanScanUTest.givenAllContactFields_whenBuildMecard_thenReturnCompleteMecardString ( )
package
Here is the call graph for this function:

◆ givenBlackColor_whenConvertToHex_thenReturn000000()

void fr.softsf.canscan.CanScanUTest.givenBlackColor_whenConvertToHex_thenReturn000000 ( )
package
Here is the call graph for this function:

◆ givenBlackWhiteImage_whenDrawSquareFinderPattern_thenPatternDrawnAtOrigin()

void fr.softsf.canscan.CanScanUTest.givenBlackWhiteImage_whenDrawSquareFinderPattern_thenPatternDrawnAtOrigin ( )
package
Here is the call graph for this function:

◆ givenBlueColorSelected_whenChooseBgColor_thenButtonTextAndColorUpdated()

void fr.softsf.canscan.CanScanUTest.givenBlueColorSelected_whenChooseBgColor_thenButtonTextAndColorUpdated ( )
package
Here is the call graph for this function:

◆ givenColorDialogCancelled_whenChooseColor_thenButtonTextUnchanged()

void fr.softsf.canscan.CanScanUTest.givenColorDialogCancelled_whenChooseColor_thenButtonTextUnchanged ( )
package
Here is the call graph for this function:

◆ givenConfigWithCustomColors_whenGenerateQrCodeImage_thenReturn300x300Image()

void fr.softsf.canscan.CanScanUTest.givenConfigWithCustomColors_whenGenerateQrCodeImage_thenReturn300x300Image ( ) throws Exception
package
Here is the call graph for this function:

◆ givenConfigWithLargeLogoRatio_whenGenerateQrCodeImage_thenReturnValidImage()

void fr.softsf.canscan.CanScanUTest.givenConfigWithLargeLogoRatio_whenGenerateQrCodeImage_thenReturnValidImage ( ) throws Exception
package
Here is the call graph for this function:

◆ givenConfigWithoutLogo_whenGenerateQrCodeImage_thenReturn400x400Image()

void fr.softsf.canscan.CanScanUTest.givenConfigWithoutLogo_whenGenerateQrCodeImage_thenReturn400x400Image ( ) throws Exception
package
Here is the call graph for this function:

◆ givenConfigWithRoundedModules_whenGenerateQrCodeImage_thenReturn400x400Image()

void fr.softsf.canscan.CanScanUTest.givenConfigWithRoundedModules_whenGenerateQrCodeImage_thenReturn400x400Image ( ) throws Exception
package
Here is the call graph for this function:

◆ givenConfigWithZeroMargin_whenGenerateQrCodeImage_thenReturnValidImage()

void fr.softsf.canscan.CanScanUTest.givenConfigWithZeroMargin_whenGenerateQrCodeImage_thenReturnValidImage ( ) throws Exception
package
Here is the call graph for this function:

◆ givenCustomColor_whenConvertToHex_thenReturnCorrectHex()

void fr.softsf.canscan.CanScanUTest.givenCustomColor_whenConvertToHex_thenReturnCorrectHex ( )
package
Here is the call graph for this function:

◆ givenDifferentImageRatios_whenDrawLogoIfPresent_thenLogoScaledCorrectly()

void fr.softsf.canscan.CanScanUTest.givenDifferentImageRatios_whenDrawLogoIfPresent_thenLogoScaledCorrectly ( double ratio) throws Exception
package
Here is the call graph for this function:

◆ givenEmptyMecardFields_whenBuildQrData_thenReturnEmptyString()

void fr.softsf.canscan.CanScanUTest.givenEmptyMecardFields_whenBuildQrData_thenReturnEmptyString ( )
package
Here is the call graph for this function:

◆ givenFileSelected_whenBrowseLogo_thenLogoFieldUpdated()

void fr.softsf.canscan.CanScanUTest.givenFileSelected_whenBrowseLogo_thenLogoFieldUpdated ( )
package
Here is the call graph for this function:

◆ givenFileSelectionCancelled_whenBrowseLogo_thenLogoFieldUnchanged()

void fr.softsf.canscan.CanScanUTest.givenFileSelectionCancelled_whenBrowseLogo_thenLogoFieldUnchanged ( )
package
Here is the call graph for this function:

◆ givenFreeMode_whenGetModeText_thenReturnSaisieLibre()

void fr.softsf.canscan.CanScanUTest.givenFreeMode_whenGetModeText_thenReturnSaisieLibre ( )
package
Here is the call graph for this function:

◆ givenFreeMode_whenSwitchToMecardMode_thenCurrentModeIsMecard()

void fr.softsf.canscan.CanScanUTest.givenFreeMode_whenSwitchToMecardMode_thenCurrentModeIsMecard ( )
package
Here is the call graph for this function:

◆ givenFreeModeWithText_whenBuildQrData_thenReturnFreeText()

void fr.softsf.canscan.CanScanUTest.givenFreeModeWithText_whenBuildQrData_thenReturnFreeText ( )
package
Here is the call graph for this function:

◆ givenJPEGLogo_whenDrawLogoIfPresent_thenLogoDrawnSuccessfully()

void fr.softsf.canscan.CanScanUTest.givenJPEGLogo_whenDrawLogoIfPresent_thenLogoDrawnSuccessfully ( ) throws Exception
package
Here is the call graph for this function:

◆ givenLargeQRSize_whenDrawLogoIfPresent_thenLogoScaledProperly()

void fr.softsf.canscan.CanScanUTest.givenLargeQRSize_whenDrawLogoIfPresent_thenLogoScaledProperly ( ) throws Exception
package
Here is the call graph for this function:

◆ givenLogoWithTransparency_whenDrawLogoIfPresent_thenLogoDrawnWithAlpha()

void fr.softsf.canscan.CanScanUTest.givenLogoWithTransparency_whenDrawLogoIfPresent_thenLogoDrawnWithAlpha ( ) throws Exception
package
Here is the call graph for this function:

◆ givenMarginAboveMaximum_whenMarginFieldCheck_thenGetMarginSetTo10()

void fr.softsf.canscan.CanScanUTest.givenMarginAboveMaximum_whenMarginFieldCheck_thenGetMarginSetTo10 ( )
package
Here is the call graph for this function:

◆ givenMecardMode_whenGetModeText_thenReturnContact()

void fr.softsf.canscan.CanScanUTest.givenMecardMode_whenGetModeText_thenReturnContact ( )
package
Here is the call graph for this function:

◆ givenMecardMode_whenSwitchToFreeMode_thenCurrentModeIsFree()

void fr.softsf.canscan.CanScanUTest.givenMecardMode_whenSwitchToFreeMode_thenCurrentModeIsFree ( )
package
Here is the call graph for this function:

◆ givenMecardModeWithContactData_whenBuildQrData_thenReturnMecardString()

void fr.softsf.canscan.CanScanUTest.givenMecardModeWithContactData_whenBuildQrData_thenReturnMecardString ( )
package
Here is the call graph for this function:

◆ givenNegativeMargin_whenMarginFieldCheck_thenGetMarginSetTo0()

void fr.softsf.canscan.CanScanUTest.givenNegativeMargin_whenMarginFieldCheck_thenGetMarginSetTo0 ( )
package
Here is the call graph for this function:

◆ givenNonExistentLogoFile_whenDrawLogoIfPresent_thenReturnWithoutException()

void fr.softsf.canscan.CanScanUTest.givenNonExistentLogoFile_whenDrawLogoIfPresent_thenReturnWithoutException ( )
package
Here is the call graph for this function:

◆ givenNullConfig_whenDrawLogoIfPresent_thenReturnWithoutException()

void fr.softsf.canscan.CanScanUTest.givenNullConfig_whenDrawLogoIfPresent_thenReturnWithoutException ( )
package
Here is the call graph for this function:

◆ givenNullGraphics_whenDrawLogoIfPresent_thenReturnWithoutException()

void fr.softsf.canscan.CanScanUTest.givenNullGraphics_whenDrawLogoIfPresent_thenReturnWithoutException ( ) throws Exception
package
Here is the call graph for this function:

◆ givenNullLogoFile_whenDrawLogoIfPresent_thenReturnWithoutException()

void fr.softsf.canscan.CanScanUTest.givenNullLogoFile_whenDrawLogoIfPresent_thenReturnWithoutException ( )
package
Here is the call graph for this function:

◆ givenOnlyNameField_whenBuildMecard_thenReturnMecardWithNameOnly()

void fr.softsf.canscan.CanScanUTest.givenOnlyNameField_whenBuildMecard_thenReturnMecardWithNameOnly ( )
package
Here is the call graph for this function:

◆ givenQrImage_whenDrawFinderPatterns_thenAllThreePatternsDrawn()

void fr.softsf.canscan.CanScanUTest.givenQrImage_whenDrawFinderPatterns_thenAllThreePatternsDrawn ( )
package
Here is the call graph for this function:

◆ givenRatioPercent_whenRatioFieldCheck_thenGetRatioSetCorrectly()

void fr.softsf.canscan.CanScanUTest.givenRatioPercent_whenRatioFieldCheck_thenGetRatioSetCorrectly ( int sliderValue,
double expectedRatio )
package
Here is the call graph for this function:

◆ givenRedColorSelected_whenChooseQrColor_thenButtonTextAndColorUpdated()

void fr.softsf.canscan.CanScanUTest.givenRedColorSelected_whenChooseQrColor_thenButtonTextAndColorUpdated ( )
package
Here is the call graph for this function:

◆ givenSmallQRSize_whenDrawLogoIfPresent_thenLogoScaledProperly()

void fr.softsf.canscan.CanScanUTest.givenSmallQRSize_whenDrawLogoIfPresent_thenLogoScaledProperly ( ) throws Exception
package
Here is the call graph for this function:

◆ givenValidLogo_whenDrawLogoIfPresent_thenLogoCenteredCorrectly()

void fr.softsf.canscan.CanScanUTest.givenValidLogo_whenDrawLogoIfPresent_thenLogoCenteredCorrectly ( ) throws Exception
package
Here is the call graph for this function:

◆ givenValidLogo_whenDrawLogoIfPresent_thenLogoDrawnOnImage()

void fr.softsf.canscan.CanScanUTest.givenValidLogo_whenDrawLogoIfPresent_thenLogoDrawnOnImage ( ) throws Exception
package
Here is the call graph for this function:

◆ givenValidMargin4_whenMarginFieldCheck_thenGetMarginUpdatedTo4()

void fr.softsf.canscan.CanScanUTest.givenValidMargin4_whenMarginFieldCheck_thenGetMarginUpdatedTo4 ( )
package
Here is the call graph for this function:

◆ givenVariousSizeInputs_whenValidateAndGetSize_thenReturnExpectedResult()

void fr.softsf.canscan.CanScanUTest.givenVariousSizeInputs_whenValidateAndGetSize_thenReturnExpectedResult ( String input,
int expected ) throws Exception
package
Here is the call graph for this function:

◆ givenWhiteColor_whenConvertToHex_thenReturnFFFFFF()

void fr.softsf.canscan.CanScanUTest.givenWhiteColor_whenConvertToHex_thenReturnFFFFFF ( )
package
Here is the call graph for this function:

◆ givenZeroImageRatio_whenDrawLogoIfPresent_thenReturnWithoutException()

void fr.softsf.canscan.CanScanUTest.givenZeroImageRatio_whenDrawLogoIfPresent_thenReturnWithoutException ( ) throws Exception
package
Here is the call graph for this function:

◆ setUp()

void fr.softsf.canscan.CanScanUTest.setUp ( ) throws InterruptedException, InvocationTargetException
package

Initialisation de l'instance de test et configuration des champs par défaut.

◆ tearDown()

void fr.softsf.canscan.CanScanUTest.tearDown ( ) throws InterruptedException, InvocationTargetException
package

Nettoyage après chaque test : fermeture de la fenêtre et libération des ressources.

Here is the call graph for this function:

Member Data Documentation

◆ colorOperation

ColorOperation fr.softsf.canscan.CanScanUTest.colorOperation
private

◆ generator

CanScan fr.softsf.canscan.CanScanUTest.generator
private

◆ tempDir

File fr.softsf.canscan.CanScanUTest.tempDir
package

The documentation for this class was generated from the following file: