<commit_before>//
//  PieSerieSpec.swift
//  SwiftyEcharts
//
//  Created by <NAME> on 29/07/2017.
//  Copyright © 2017 com.pluto-y. All rights reserved.
//

import Quick
import Nimble
@testable import SwiftyEcharts

class PieSerieSpec: QuickSpec {
    override func spec() {
        let showLabelLineContentValue = false
        let lengthLabelLineContentValue: Float = 7.77777
        let length2LabelLineContentValue: Float = 65.374
        let smoothLabelLineContentValue = true
        let lineStyleLabelLineContentValue = LineStyle(
            .curveness(6.485),
            .type(LineType.dashed)
        )
        
        let labelLineContent = PieSerie.LabelLineContent()
        labelLineContent.show = showLabelLineContentValue
        labelLineContent.length = lengthLabelLineContentValue
        labelLineContent.length2 = length2LabelLineContentValue
        labelLineContent.smooth = smoothLabelLineContentValue
        labelLineContent.lineStyle = lineStyleLabelLineContentValue
        
        describe("For PieSerie.LabelLineContent") { 
            it("needs to check the jsonString") {
                let resultDic: [String: Jsonable] = [
                    "show": showLabelLineContentValue,
                    "length": lengthLabelLineContentValue,
                    "length2": length2LabelLineContentValue,
                    "smooth": smoothLabelLineContentValue,
                    "lineStyle": lineStyleLabelLineContentValue
                ]
                
                expect(labelLineContent.jsonString).to(equal(resultDic.jsonString))
            }
            
            it("needs to check the Enumable") {
                let labelLineContentByEnums = PieSerie.LabelLineContent(
                    .show(showLabelLineContentValue),
                    .length(lengthLabelLineContentValue),
                    .length2(length2LabelLineContentValue),
                    .smooth(smoothLabelLineContentValue),
                    .lineStyle(lineStyleLabelLineContentValue)
                )
                
                expect(labelLineContentByEnums.jsonString).to(equal(labelLineContent.jsonString))
            }
        }
    }
}<commit_msg>test: Add test cases for `PieSerie.LabelLine`<commit_after>//
//  PieSerieSpec.swift
//  SwiftyEcharts
//
//  Created by <NAME> on 29/07/2017.
//  Copyright © 2017 com.pluto-y. All rights reserved.
//

import Quick
import Nimble
@testable import SwiftyEcharts

class PieSerieSpec: QuickSpec {
    override func spec() {
        let showLabelLineContentValue = false
        let lengthLabelLineContentValue: Float = 7.77777
        let length2LabelLineContentValue: Float = 65.374
        let smoothLabelLineContentValue = true
        let lineStyleLabelLineContentValue = LineStyle(
            .curveness(6.485),
            .type(LineType.dashed)
        )
        
        let labelLineContent = PieSerie.LabelLineContent()
        labelLineContent.show = showLabelLineContentValue
        labelLineContent.length = lengthLabelLineContentValue
        labelLineContent.length2 = length2LabelLineContentValue
        labelLineContent.smooth = smoothLabelLineContentValue
        labelLineContent.lineStyle = lineStyleLabelLineContentValue
        
        describe("For PieSerie.LabelLineContent") { 
            it("needs to check the jsonString") {
                let resultDic: [String: Jsonable] = [
                    "show": showLabelLineContentValue,
                    "length": lengthLabelLineContentValue,
                    "length2": length2LabelLineContentValue,
                    "smooth": smoothLabelLineContentValue,
                    "lineStyle": lineStyleLabelLineContentValue
                ]
                
                expect(labelLineContent.jsonString).to(equal(resultDic.jsonString))
            }
            
            it("needs to check the Enumable") {
                let labelLineContentByEnums = PieSerie.LabelLineContent(
                    .show(showLabelLineContentValue),
                    .length(lengthLabelLineContentValue),
                    .length2(length2LabelLineContentValue),
                    .smooth(smoothLabelLineContentValue),
                    .lineStyle(lineStyleLabelLineContentValue)
                )
                
                expect(labelLineContentByEnums.jsonString).to(equal(labelLineContent.jsonString))
            }
        }
        
        let normalLabelLineValue = labelLineContent
        let emphasisLabelLineValue = PieSerie.LabelLineContent(
            .show(true),
            .length(7.472),
            .length2(47.373),
            .smooth(false),
            .lineStyle(LineStyle())
        )
        
        let labelLine = PieSerie.LabelLine()
        labelLine.normal = normalLabelLineValue
        labelLine.emphasis = emphasisLabelLineValue
        
        describe("For PieSerie.LabelLien") {
            it("needs to check the jsonString") {
                let resultDic: [String: Jsonable] = [
                    "normal": normalLabelLineValue,
                    "emphasis": emphasisLabelLineValue
                ]
                
                expect(labelLine.jsonString).to(equal(resultDic.jsonString))
            }
            
            it("needs to check the Enumable") {
                let labelLineByEnums = PieSerie.LabelLine(
                    .normal(normalLabelLineValue),
                    .emphasis(emphasisLabelLineValue)
                )
                
                expect(labelLineByEnums.jsonString).to(equal(labelLine.jsonString))
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.07365237502223804, 'fraction_numerical': 0.01387653442447963, 'mean_word_length': 1.8365287588294652, 'pattern_counts': {'":': 12, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3211284', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1369, 'n_words': 242}