CanScan
Loading...
Searching...
No Matches
fr.softsf.canscan.CanScanUTest Class Reference
+ 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)
 
void givenWhiteColor_whenConvertToHex_thenReturnFFFFFF ()
 
void givenZeroImageRatio_whenDrawLogoIfPresent_thenReturnWithoutException () throws Exception
 
void setUp ()
 

Package Attributes

File tempDir
 

Private Member Functions

File createTestLogoFile (String filename) throws IOException
 
File createTestLogoFileWithAlpha () throws IOException
 
void executeWithoutDialog (Runnable test)
 

Private Attributes

ColorOperation colorOperation
 
CanScan generator
 

Member Function Documentation

◆ createTestLogoFile()

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

◆ createTestLogoFileWithAlpha()

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

◆ executeWithoutDialog()

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

◆ givenAllBlankFields_whenBuildMecard_thenReturnEmptyString()

void fr.softsf.canscan.CanScanUTest.givenAllBlankFields_whenBuildMecard_thenReturnEmptyString ( )
package

◆ givenAllContactFields_whenBuildMecard_thenReturnCompleteMecardString()

void fr.softsf.canscan.CanScanUTest.givenAllContactFields_whenBuildMecard_thenReturnCompleteMecardString ( )
package

◆ givenBlackColor_whenConvertToHex_thenReturn000000()

void fr.softsf.canscan.CanScanUTest.givenBlackColor_whenConvertToHex_thenReturn000000 ( )
package

◆ 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

◆ givenColorDialogCancelled_whenChooseColor_thenButtonTextUnchanged()

void fr.softsf.canscan.CanScanUTest.givenColorDialogCancelled_whenChooseColor_thenButtonTextUnchanged ( )
package

◆ 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

◆ 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

◆ 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

◆ givenFreeMode_whenSwitchToMecardMode_thenCurrentModeIsMecard()

void fr.softsf.canscan.CanScanUTest.givenFreeMode_whenSwitchToMecardMode_thenCurrentModeIsMecard ( )
package

◆ givenFreeModeWithText_whenBuildQrData_thenReturnFreeText()

void fr.softsf.canscan.CanScanUTest.givenFreeModeWithText_whenBuildQrData_thenReturnFreeText ( )
package

◆ 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

◆ givenMecardMode_whenGetModeText_thenReturnContact()

void fr.softsf.canscan.CanScanUTest.givenMecardMode_whenGetModeText_thenReturnContact ( )
package

◆ givenMecardMode_whenSwitchToFreeMode_thenCurrentModeIsFree()

void fr.softsf.canscan.CanScanUTest.givenMecardMode_whenSwitchToFreeMode_thenCurrentModeIsFree ( )
package

◆ givenMecardModeWithContactData_whenBuildQrData_thenReturnMecardString()

void fr.softsf.canscan.CanScanUTest.givenMecardModeWithContactData_whenBuildQrData_thenReturnMecardString ( )
package

◆ givenNegativeMargin_whenMarginFieldCheck_thenGetMarginSetTo0()

void fr.softsf.canscan.CanScanUTest.givenNegativeMargin_whenMarginFieldCheck_thenGetMarginSetTo0 ( )
package

◆ 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

◆ 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

◆ givenRedColorSelected_whenChooseQrColor_thenButtonTextAndColorUpdated()

void fr.softsf.canscan.CanScanUTest.givenRedColorSelected_whenChooseQrColor_thenButtonTextAndColorUpdated ( )
package

◆ 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

◆ givenVariousSizeInputs_whenValidateAndGetSize_thenReturnExpectedResult()

void fr.softsf.canscan.CanScanUTest.givenVariousSizeInputs_whenValidateAndGetSize_thenReturnExpectedResult ( String input,
int expected )
package

◆ givenWhiteColor_whenConvertToHex_thenReturnFFFFFF()

void fr.softsf.canscan.CanScanUTest.givenWhiteColor_whenConvertToHex_thenReturnFFFFFF ( )
package

◆ 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 ( )
package

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: