This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Nimble | |
import Quick | |
@testable import UnitTests | |
class Dummy{} | |
class WatchTest: QuickSpec{ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func spec() { | |
var watch : Watch! | |
//Component (i.e., Watch Modal Data ) in test | |
describe("Watch Modal Data Tests"){ | |
//Preparation of data | |
beforeEach { | |
watch = Watch(name: "Men's Business Quartz Watch CAGNARY 6828", | |
price: 11.69, brand: Brand(id: 6828, name: "CAGARNY")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Watch { | |
var name:String | |
var price: Double | |
var brand: Brand | |
} | |
struct Brand { | |
var id: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuickStructure: QuickSpec{ | |
override func spec() { | |
describe("Component to be Verified"){ | |
beforeEach { | |
//set up data | |
} | |
context("State of Test Case"){ | |
it(" Expect Validations "){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//class check | |
expect(watch).to(beAKindOf(Watch.self)) | |
expect(watch).toNot(beAKindOf(Dummy.self)) | |
//instance check | |
expect(watch).to(beAnInstanceOf(Watch.self)) | |
expect(watch).toNot(beAnInstanceOf(Dummy.self)) | |
//string and name presence check | |
expect(watch.name).to(beAnInstanceOf(String.self)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("Price validations"){ | |
expect(watch.price).toNot(beNil()) | |
expect(watch.price).to(beTruthy()) | |
//evaluating boundary cases | |
expect(watch.price).toNot(beLessThan(0)) | |
expect(watch.price).to(beCloseTo(11, within: 0.69)) | |
expect(watch.price).to(beLessThanOrEqualTo(11.69)) | |
expect(watch.price).to(beGreaterThan(Double.pi)) | |
expect(watch.price).toNot(beGreaterThan(11.69)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "uid": 1, "name": "Avengers: Infinity War", "shortDesc": "Lorem Ipsum", "duration": 120, "thumbnailUrl": "https://s3.amazonaws.com/mobile.scribd.com/ios-interview-test/avg.jpg", "category": 1, "venue": 1 }, | |
{ "uid": 2, "name": "Deadpool 2", "shortDesc": "Lorem Ipsum", "duration": 120, "thumbnailUrl": "https://s3.amazonaws.com/mobile.scribd.com/ios-interview-test/deadpool.jpg", "category": 1, "venue": 2 }, | |
{ "uid": 3, "name": "Solo: A Star Wars Movie", "shortDesc": "Lorem Ipsum", "duration": 120, "thumbnailUrl": "https://s3.amazonaws.com/mobile.scribd.com/ios-interview-test/solo.jpg", "category": 1, "venue": 3 }, | |
{ "uid": 4, "name": "Game Night", "shortDesc": "Lorem Ipsum", "duration": 120, "thumbnailUrl": "https://s3.amazonaws.com/mobile.scribd.com/ios-interview-test/gamenight.jpg", "category": 2, "venue": 1 }, | |
{ "uid": 5, "name": "Blockers", "shortDesc": "Lorem Ipsum", "duration": 120, "thumbnailUrl": "https://s3.amazonaws.com/mobile.scribd.com/ios-interview-test/blockers.jpg", "category": 2, " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "uid": 1, "name": "Avengers: Infinity War", "shortDesc": "Lorem Ipsum", "duration": 120, "thumbnailUrl": "https://s3.amazonaws.com/mobile.scribd.com/ios-interview-test/avg.jpg", "category": 1, "venue": 1 }, | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"user_data": { | |
"full_name": "John Sundell", | |
"user_age": 31 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CreditCardListViewController.swift | |
// BUPNative | |
// | |
// Created by Venkatnarayansetty, Badarinath on 7/24/19. | |
// | |
import Foundation | |
import UIKit |
OlderNewer